diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index 1ba6b2b..c4df82d 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -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 diff --git a/zsh/exports.zsh b/zsh/exports.zsh index cc36a5f..0de31ae 100644 --- a/zsh/exports.zsh +++ b/zsh/exports.zsh @@ -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