From b7ce845692751f4de6d10da7e16904f1573b8cd2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 20 Jan 2018 22:54:31 +1300 Subject: Activate syntax settings conditionally Per an oft-made recommendation on /r/vim .vimrc review threads: > Re-sourcing the vimrc won't clobber any of your personal highlight > settings and the if part helps avoid unneeded re-execution/reprocessing. --- vim/config/syntax.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vim/config/syntax.vim b/vim/config/syntax.vim index b493c0a9..5fdd1a82 100644 --- a/vim/config/syntax.vim +++ b/vim/config/syntax.vim @@ -2,8 +2,10 @@ if has('syntax') " Use syntax highlighting with 100 lines of context - silent! syntax enable - silent! syntax sync minlines=100 + if !has('g:syntax_on') + silent! syntax enable + silent! syntax sync minlines=100 + endif " If we can, detect a light background, but default to a dark one. This is " only because it's more likely the author of this configuration will be -- cgit v1.2.3