[zsh] Move init_env_vi -> init-vi and make it a proper function
This commit is contained in:
parent
9ef882cb84
commit
ae6fd37cf9
3 changed files with 19 additions and 15 deletions
18
zsh/func/init-vi
Normal file
18
zsh/func/init-vi
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env zsh
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
function init-vi
|
||||
{
|
||||
# Prefer nvim and vim, in that order, over standard vi, which is insufferable.
|
||||
if whence -cp nvim &> /dev/null; then
|
||||
alias vi=nvim
|
||||
export EDITOR=nvim
|
||||
elif whence -cp vim &> /dev/null; then
|
||||
alias vi=vim
|
||||
export EDITOR=vim
|
||||
else
|
||||
export EDITOR=vi
|
||||
fi
|
||||
}
|
||||
|
||||
init-vi "$@"
|
|
@ -1,14 +0,0 @@
|
|||
#!/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 &> /dev/null; then
|
||||
alias vi=nvim
|
||||
export EDITOR=nvim
|
||||
elif whence -cp vim &> /dev/null; then
|
||||
alias vi=vim
|
||||
export EDITOR=vim
|
||||
fi
|
||||
|
||||
export editor=vi
|
2
zshenv
2
zshenv
|
@ -26,7 +26,7 @@ typeset -a zsh_init_env_functions=( \
|
|||
init-zsh-helpers \
|
||||
init_env_python \
|
||||
init_env_playdate \
|
||||
init_env_vi \
|
||||
init-vi \
|
||||
init_env_$SYS \
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue