nyoom-engineering/nyoom.nvim

NVIM_APPNAME awareness

aleksandersumowski opened this issue · 5 comments

The 0.9.0 release supports a mechanism to switch between multiple configs. From what I understand nyoom.nvim always assumes that it's the only configuration and installs packer/plugins/etc centrally. It would be great to be able to check out nyoom while keeping your existing config easily available

jeebak commented

This is what I had to do to check out nyoom under nvim 0.9.0:

mkdir -p \
  ~/.config/nvim-profiles \
  ~/.cache/nvim-profiles \
  ~/.local/share/nvim-profiles \
  ~/.local/state/nvim-profiles

git clone --depth 1 https://github.com/nyoom-engineering/nyoom.nvim.git \
  ~/.config/nvim-profiles/nyoom

cd ~/.config/nvim-profiles/nyoom

Update the bin/nyoom file thusly:

Click for patchable diff
diff --git a/bin/nyoom b/bin/nyoom
index 562f6ae..a540e69 100755
--- a/bin/nyoom
+++ b/bin/nyoom
@@ -3,12 +3,14 @@
 set -o errexit -o pipefail -o nounset
 
 # people like xdg
-CONFIG_PATH="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim"
-CACHE_PATH="${XDG_CACHE_HOME:-${HOME}/.cache}/nvim"
-DATA_PATH="${XDG_DATA_HOME:-${HOME}/.local/share}/nvim"
+CONFIG_PATH="${XDG_CONFIG_HOME:-${HOME}/.config}/${NVIM_APPNAME:-nvim}"
+CACHE_PATH="${XDG_CACHE_HOME:-${HOME}/.cache}/${NVIM_APPNAME:-nvim}"
+DATA_PATH="${XDG_DATA_HOME:-${HOME}/.local/share}/${NVIM_APPNAME:-nvim}"
 NYOOM_CONFIG="${XDG_DATA_HOME:-${HOME}/.config}/nyoom"
 
-# silently enter ~/.config/nvim when updating
+mkdir -p "$CONFIG_PATH" "$CACHE_PATH" "$DATA_PATH" "$NYOOM_CONFIG"
+
+# silently enter ${CONFIG_PATH} when updating
 pushd ${CONFIG_PATH} >/dev/null
 
 function print_nyoom_status() {

Then, run:

NVIM_APPNAME=nvim-profiles/nyoom bin/nyoom install
NVIM_APPNAME=nvim-profiles/nyoom bin/nyoom sync

NVIM_APPNAME=nvim-profiles/nyoom nvim

Thanks for a solution. Looks like it could be a PR?

jeebak commented

Thanks for a solution. Looks like it could be a PR?

You're welcome! Feel free to submit it as a PR! I explicitly give you, or anyone else reading this, my blessing to do w/ it what you will.

I've created a PR: #131

Since the PR is merged, shouldn't this issue be closed?