]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Only use vim -p when it's available.
authorSimon Ruderich <simon@ruderich.org>
Fri, 6 Feb 2009 16:05:38 +0000 (17:05 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 16 Feb 2009 15:34:42 +0000 (16:34 +0100)
-p is available since Vim 7.

zsh/rc

diff --git a/zsh/rc b/zsh/rc
index a505a4e719f87e13b56df7ade9802bf1f1de2cf9..88eb6b4f546c7c9e0fbb80ef6300e0340264db31 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -205,8 +205,10 @@ alias diff='diff -u'
 # Display all files and use human readable sizes.
 alias du='du -sh'
 
-# Multiple files given to Vim are opened in tabs.
-alias vim='vim -p'
+# Multiple files given to Vim are opened in tabs, supported since Vim 7.
+if [[ ${${${(f)"$(vim --version)"}[1]#VIM - Vi IMproved }%% *} == 7* ]]; then
+    alias vim='vim -p'
+fi
 
 # Shortcuts for often used programs.
 alias e='elinks'