aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-01-20 22:54:31 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-01-20 22:54:31 +1300
commitb7ce845692751f4de6d10da7e16904f1573b8cd2 (patch)
tree2e793c653f1d7781f875e8fad139b9fd983f9c13 /vim
parentMerge branch 'release/v0.24.0' into develop (diff)
downloaddotfiles-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.
Diffstat (limited to 'vim')
-rw-r--r--vim/config/syntax.vim6
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