[zsh] Move vi init to init_env_vi; set EDITOR in that function
This commit is contained in:
parent
4317bfd61e
commit
09ea02303d
4 changed files with 6 additions and 5 deletions
14
zsh/func/init_env_vi
Normal file
14
zsh/func/init_env_vi
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue