]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
vimrc: Fix compatibility for older Vim versions.
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index 83ad31581554ef4fd25b2e1e0017344645303abe..bc126c8e63726739a3a235acf91c3810f4da7f76 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -641,8 +641,11 @@ if has('autocmd')
 " Don't ignore case while in insert mode, but ignore case in all other modes.
 " This causes <C-N>/<C-P> to honor the case and thus only complete matching
 " capitalization. But while searching (/) 'ignorecase' is used.
-        autocmd InsertEnter * set noignorecase
-        autocmd InsertLeave * set   ignorecase
+" InsertEnter/InsertLeave doesn't exist in older Vims.
+        if exists('##InsertEnter') && exists('##InsertLeave')
+            autocmd InsertEnter * set noignorecase
+            autocmd InsertLeave * set   ignorecase
+        endif
 
 " AFTER/FTPLUGIN AUTO COMMANDS