aboutsummaryrefslogtreecommitdiff
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
parentb26ecdb89212c7b2af3219a5b59a8f9f9a4a9245 (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.
-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