sh: Add flexible vi/vim/nvim invocation

`v` used to call nvim and nothing else.
Now, it checks for nvim and calls that,
checks for vim and calls that,
or checks for vi and calls that before failing.
This commit is contained in:
Marty Oehme 2021-03-05 14:03:46 +01:00
parent b8388bf8fd
commit 9a476e4228
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -8,7 +8,14 @@ exist() { type "$1" >/dev/null 2>&1; }
unalias -a unalias -a
# v shorthand for neovim # v shorthand for neovim
if exist nvim; then
alias v="nvim" alias v="nvim"
alias vs="nvim -c 'ScratchPad'"
elif exist vim; then
alias v="vim"
else
alias v="vi"
fi
# exit shell mimicks vim # exit shell mimicks vim
alias :q="exit" alias :q="exit"