Skip to content

Commit

Permalink
Add script to swap in a ~/.config/nvim/lua/grs link to repo
Browse files Browse the repository at this point in the history
 - to keep sumneko_lua from getting confused
 - temporary until I know how to configure sumneko_lua better?
  • Loading branch information
grscheller committed Dec 1, 2022
1 parent 1d0247f commit 8e3812e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions grsSwap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/fish
#
# Toggle in a symlink ~/.config/nvim/lua -> .../dotfiles/config/nvim/lua
#
# Sumneko_lua, at least when configured with the Neovim runtime
# path, will put ~/.config/nvim files into its "workspace" in ways
# which override the corresponding source repo source files.
#
# This script is a temporary hack until I better understand how
# to configure sumneko_lua not to do this.
#
# TODO: Make this a function, otherwise cd commands don't work.
# This is is due to script running in another process.
#

set -q XDG_CONFIG_HOME; or set -lx XDG_CONFIG_HOME ~/.config
set -q DOTFILE_GIT_REPO; or set -gx DOTFILE_GIT_REPO ~/devel/dotfiles

if test -d ~/.config/nvim_lua_grs_backup
rm $XDG_CONFIG_HOME/nvim/lua/grs
mv $XDG_CONFIG_HOME/nvim_lua_grs_backup $XDG_CONFIG_HOME/nvim/lua/grs
printf '\nEdit Neovim config files directly in %s.' $DOTFILE_GIT_REPO
printf '\nIssue git commands from dotfiles repo, %s.\n' $DOTFILE_GIT_REPO
cd $DOTFILE_GIT_REPO
else
mv ~/.config/nvim/lua/grs ~/.config/nvim_lua_grs_backup
ln -s $DOTFILE_GIT_REPO/config/nvim/lua/grs $XDG_CONFIG_HOME/nvim/lua/grs
printf '\nEdit Neovim config files thru %s/nvim link.' $XDG_CONFIG_HOME
printf '\nStill issue git commands from %s.\n' $DOTFILE_GIT_REPO
cd $XDG_CONFIG_HOME/nvim
end

0 comments on commit 8e3812e

Please sign in to comment.