Browse Source

Set vim as default $EDITOR

Emmanuel Bouthenot 8 years ago
parent
commit
48a975cfb6
1 changed files with 7 additions and 4 deletions
  1. 7 4
      zsh/zshrc

+ 7 - 4
zsh/zshrc

@@ -70,11 +70,14 @@ unset VIMPAGER
 # Vim
 #
 
-VIMRC="$(readlink -f "${ZDOTDIR}/../tools/vim/vimrc")"
-if [[ -f "${VIMRC}" ]]; then
-    export VIMINIT="source ${VIMRC}"
+if (( $+commands[vim] )); then
+    VIMRC="$(readlink -f "${ZDOTDIR}/../tools/vim/vimrc")"
+    if [[ -f "${VIMRC}" ]]; then
+        export VIMINIT="source ${VIMRC}"
+    fi
+    unset VIMRC
+    export EDITOR="vim"
 fi
-unset VIMRC
 
 #
 # Git