20 lines
428 B
Bash
20 lines
428 B
Bash
#!/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
|
|
|
|
export VISUAL=$EDITOR
|
|
}
|
|
|
|
init-env-vi "$@"
|