zsh: use nvim instead of vim when available

This commit is contained in:
Thomas Preisner 2021-09-22 13:06:17 +02:00
parent d13d72ec80
commit 4a7a665edb
2 changed files with 8 additions and 1 deletions

View file

@ -45,6 +45,11 @@ alias grep='grep --binary-files=without-match -H -n --color=always'
alias less='less -r'
alias cp='cp -i'
alias mv='mv -i'
# use nvim instead of vim when available
if type nvim >/dev/null 2>&1; then
alias vi='vim'
alias vim='nvim'
fi
alias automake='{ while true; do inotifywait -r -e modify . && make; done; } &'
# ===== sp aliases

View file

@ -1,4 +1,6 @@
# set EDITOR variable
if type vim >/dev/null 2>&1; then
if type nvim >/dev/null 2>&1; then
export EDITOR="nvim"
elif type vim >/dev/null 2>&1; then
export EDITOR="vim"
fi