-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to swap in a ~/.config/nvim/lua/grs link to repo
- to keep sumneko_lua from getting confused - temporary until I know how to configure sumneko_lua better?
- Loading branch information
1 parent
1d0247f
commit 8e3812e
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |