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:
parent
b8388bf8fd
commit
9a476e4228
1 changed files with 8 additions and 1 deletions
|
@ -8,7 +8,14 @@ exist() { type "$1" >/dev/null 2>&1; }
|
|||
unalias -a
|
||||
|
||||
# v shorthand for neovim
|
||||
if exist nvim; then
|
||||
alias v="nvim"
|
||||
alias vs="nvim -c 'ScratchPad'"
|
||||
elif exist vim; then
|
||||
alias v="vim"
|
||||
else
|
||||
alias v="vi"
|
||||
fi
|
||||
|
||||
# exit shell mimicks vim
|
||||
alias :q="exit"
|
||||
|
|
Loading…
Reference in a new issue