[zsh] Give all the init-env functions consistent names

This commit is contained in:
Eryn Wells 2024-09-24 09:25:09 -07:00
parent e5505a7a69
commit f2144fcbed
8 changed files with 28 additions and 52 deletions

18
zsh/func/init-env-vi Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init-env-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-env-vi "$@"