From 45f31a03c727a8b29dfe65ac27ecfbbdf8f58d15 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 19 Jul 2018 09:15:08 +1200 Subject: Add compatible/version guard to syntax after files --- vim/after/syntax/gitcommit.vim | 6 ++++++ vim/after/syntax/messages.vim | 6 ++++++ vim/after/syntax/sh.vim | 14 ++++---------- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'vim/after') diff --git a/vim/after/syntax/gitcommit.vim b/vim/after/syntax/gitcommit.vim index e47091f9..2232e499 100644 --- a/vim/after/syntax/gitcommit.vim +++ b/vim/after/syntax/gitcommit.vim @@ -1,2 +1,8 @@ +" Don't try to make these corrections if running 'compatible' or if the +" runtime files are too old +if &compatible || v:version < 700 + finish +endif + " If my commit subject is too long, highlight it as an error. highlight link gitCommitOverflow Error diff --git a/vim/after/syntax/messages.vim b/vim/after/syntax/messages.vim index 04faa607..75fe89b9 100644 --- a/vim/after/syntax/messages.vim +++ b/vim/after/syntax/messages.vim @@ -1,3 +1,9 @@ +" Don't try to make these corrections if running 'compatible' or if the +" runtime files are too old +if &compatible || v:version < 700 + finish +endif + " The highlighting for errors in syslog/messages files is more often annoying " than useful, so just turn it off. syntax clear messagesError diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index 026e4ebd..00f95fc0 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -1,7 +1,7 @@ -" Support line continuation for this file -if &compatible - let s:cpoptions_save = &cpoptions - set cpoptions-=C +" Don't try to make these corrections if running 'compatible' or if the +" runtime files are too old +if &compatible || v:version < 700 + finish endif " If we know we have another shell type, clear away the others completely, now @@ -216,9 +216,3 @@ if exists('b:is_bash') \ variables \ wait endif - -" Restore 'cpoptions' setting if we touched it -if exists('s:cpoptions_save') - let &cpoptions = s:cpoptions_save - unlet s:cpoptions_save -endif -- cgit v1.2.3