From: Simon Ruderich Date: Sun, 19 Feb 2012 00:42:16 +0000 (+0100) Subject: vimrc: Fix compatibility for older Vim versions. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=824b44922f69ff5364d02a967628bf82c4db8aea vimrc: Fix compatibility for older Vim versions. Works fine with Vim 6.4. --- diff --git a/vimrc b/vimrc index 95a5631..7a56542 100644 --- a/vimrc +++ b/vimrc @@ -539,13 +539,17 @@ if has('autocmd') " Automatically disable 'paste' mode when leaving insert mode. Thanks to " Raimondi in #vim on Freenode (2010-08-14 23:01 CEST). Very useful as I only -" want to paste once and then 'paste' gets automatically unset. +" want to paste once and then 'paste' gets automatically unset. InsertLeave +" doesn't exist in older Vims. if exists('##InsertLeave') autocmd InsertLeave * set nopaste endif -" Write file when running :mak[e] before 'makeprg' is called. - autocmd QuickFixCmdPre * write +" Write file when running :mak[e] before 'makeprg' is called. QuickFixCmdPre +" doesn't exist in older Vims. + if exists('##QuickFixCmdPre') + autocmd QuickFixCmdPre * write + endif " AFTER/FTPLUGIN AUTO COMMANDS