diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-20 22:54:31 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-01-20 22:54:31 +1300 |
commit | b7ce845692751f4de6d10da7e16904f1573b8cd2 (patch) | |
tree | 2e793c653f1d7781f875e8fad139b9fd983f9c13 | |
parent | Merge branch 'release/v0.24.0' into develop (diff) | |
download | dotfiles-b7ce845692751f4de6d10da7e16904f1573b8cd2.tar.gz dotfiles-b7ce845692751f4de6d10da7e16904f1573b8cd2.zip |
Activate syntax settings conditionally
Per an oft-made recommendation on /r/vim .vimrc review threads:
<https://www.reddit.com/r/vim/comments/6znskl/vimrc_review_thread/dnbmvxv/>
> Re-sourcing the vimrc won't clobber any of your personal highlight
> settings and the if part helps avoid unneeded re-execution/reprocessing.
-rw-r--r-- | vim/config/syntax.vim | 6 |
1 files 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 |