[zsh] Move vi init to init_env_vi; set EDITOR in that function

This commit is contained in:
Eryn Wells 2022-05-28 09:07:40 -07:00
parent 4317bfd61e
commit 09ea02303d
4 changed files with 6 additions and 5 deletions

14
zsh/func/init_env_vi Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
# Prefer nvim and vim, in that order, over standard vi, which is insufferable.
if whence -cp nvim &> -; then
alias vi=nvim
export EDITOR=nvim
elif whence -cp vim &> -; then
alias vi=vim
export EDITOR=vim
fi
export editor=vi