2024-09-23 18:21:34 -07:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
2024-09-24 09:25:09 -07:00
|
|
|
function init-env-vi
|
2024-09-23 18:21:34 -07:00
|
|
|
{
|
|
|
|
# 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
|
2024-09-26 16:11:08 -07:00
|
|
|
|
|
|
|
export VISUAL=$EDITOR
|
2024-09-23 18:21:34 -07:00
|
|
|
}
|
|
|
|
|
2024-09-24 09:25:09 -07:00
|
|
|
init-env-vi "$@"
|