zshrc: rm PSOXIZSH_EXPERIMENTAL_NEOVIM_LUA flag

Instead, we now presume that if neovim is installed, the user will use
it over the default vim.

We also slightly refactor the entrypoint for neovim, using the default
paths for MYVIMRC, over setting VIMINIT and MYVIMRC explicitly.
This commit is contained in:
Paul Stemmet 2024-08-25 20:52:09 +00:00
parent 269c980010
commit ad874d18aa
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 16 additions and 5 deletions

21
zshrc
View File

@ -120,21 +120,32 @@ plugins+=(
if [[ "$OSTYPE" =~ "linux*" || "$OSTYPE" =~ "darwin*" || "$OSTYPE" == "cygwin" ]]
then
export VIMINIT='source $MYVIMRC'
export VIMHOME=~/.vim
# Feature flag lua based Neovim config, until this is tested
# (and we figure out how to detect if we are running nvim or vim)
if [[ -n ${PSOXIZSH_EXPERIMENTAL_NEOVIM_LUA} ]]
# If neovim is installed, assume that we will not be supporting standard vim
if which nvim &>/dev/null
then
export MYVIMRC=$PSOXIZSH/init.lua
[[ -d ~/.config/nvim/lua/config ]] || mkdir -p ~/.config/nvim/lua/config
[[ -d ~/.config/nvim/lua/plugins ]] || mkdir -p ~/.config/nvim/lua/plugins
[[ -e ~/.config/nvim/init.lua ]] || ln -s $PSOXIZSH/init.lua ~/.config/nvim/init.lua
[[ -e ~/.config/nvim/lua/plugins/init.lua ]] || echo 'return {}' > ~/.config/nvim/lua/plugins/init.lua
else
export VIMINIT='source $MYVIMRC'
export MYVIMRC=$PSOXIZSH/vimrc
cmp $PSOXIZSH/vim/autoload/plug.vim $VIMHOME/autoload/plug.vim 2>/dev/null || (
mkdir -vp $VIMHOME/autoload/
cp -av $PSOXIZSH/vim/autoload/plug.vim $VIMHOME/autoload/plug.vim
)
fi
if [[ -n ${PSOXIZSH_EXPERIMENTAL_NEOVIM_LUA} ]]
then
if [[ ! -e ~/.cache/.psoxizsh_did_warn_neovim_lua ]]
then
echo "$0:$LINENO: The environment variable 'PSOXIZSH_EXPERIMENTAL_NEOVIM_LUA' is now unused, and may be removed"
touch ~/.cache/.psoxizsh_did_warn_neovim_lua &>/dev/null
fi
fi
fi
if [[ -d ~/.ssh ]]