]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
vimrc: Fix compatibility for older Vim versions.
authorSimon Ruderich <simon@ruderich.org>
Sun, 2 Sep 2012 02:27:54 +0000 (04:27 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 2 Sep 2012 02:27:54 +0000 (04:27 +0200)
Works fine with Vim 6.4.

vimrc

diff --git a/vimrc b/vimrc
index 3a48b1e0d4fad2dbfe32059eea07fa29ff907577..491979b73622e1145d87597a652bf6284fae4362 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -353,7 +353,7 @@ if has('statusline')
     set statusline+=%02n  " buffer number
     set statusline+=%{StatuslineBufferCount()} " highest buffer number
     set statusline+=:
-    if has('modify_fname')
+    if has('modify_fname') && v:version >= 700 " some functions need 7.0
         set statusline+=%{StatuslineRelativeFilename()} " path to current file
         set statusline+=\     " space after path
     else
@@ -754,8 +754,10 @@ if has('eval')
 " Settings for securemodelines.
     " Only allow items I need (also includes spl which is not enabled by
     " default).
-    let g:secure_modelines_allowed_items = ['ft', 'spl', 'fdm',
-                                          \ 'sw', 'sts', 'noet']
+    if v:version >= 700 " need lists
+        let g:secure_modelines_allowed_items = ['ft', 'spl', 'fdm',
+                                              \ 'sw', 'sts', 'noet']
+    endif
 
 " Settings for the NERD commenter.
     " Don't create any mappings I don't want to use.