dotfiles/zsh/func/init-vi

19 lines
393 B
Text
Raw Normal View History

#!/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 "$@"