aboutsummaryrefslogtreecommitdiff
path: root/vim/after
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 03:23:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 03:23:42 +1200
commite8adb4c7d512692eeb456eca2eb1eafd35bc2ec6 (patch)
treef6b732b696ac6b716b5daf3ea0cd7123a8c362b5 /vim/after
parentMerge branch 'release/v5.0.0' into develop (diff)
downloaddotfiles-e8adb4c7d512692eeb456eca2eb1eafd35bc2ec6.tar.gz
dotfiles-e8adb4c7d512692eeb456eca2eb1eafd35bc2ec6.zip
Limit :CompilerSet coloring to compiler/*.vim
Diffstat (limited to 'vim/after')
-rw-r--r--vim/after/syntax/vim.vim36
1 files changed, 20 insertions, 16 deletions
diff --git a/vim/after/syntax/vim.vim b/vim/after/syntax/vim.vim
index c5417413..cae5c815 100644
--- a/vim/after/syntax/vim.vim
+++ b/vim/after/syntax/vim.vim
@@ -1,19 +1,23 @@
" Remove special highlighting for double-quoted strings in comments
syntax clear vimCommentString
-" Highlight :CompilerSet commands like :set/:setlocal
-syntax keyword vimCommand contained
- \ CompilerSet
-syntax region vimSet matchgroup=vimCommand
- \ start="\<CompilerSet\>"
- \ end="$" end="|" end="<[cC][rR]>"
- \ keepend
- \ matchgroup=vimNotation
- \ oneline
- \ skip="\%(\\\\\)*\\."
- \ contains=vimSetEqual
- \,vimOption
- \,vimErrSetting
- \,vimComment
- \,vimSetString
- \,vimSetMod
+" Highlight :CompilerSet commands like :set/:setlocal, but only in compiler
+" scripts in recognisable paths
+if expand('%:h:t') ==# 'compiler'
+ \ && expand('%:e') ==# 'vim'
+ syntax keyword vimCommand contained
+ \ CompilerSet
+ syntax region vimSet matchgroup=vimCommand
+ \ start="\<CompilerSet\>"
+ \ end="$" end="|" end="<[cC][rR]>"
+ \ keepend
+ \ matchgroup=vimNotation
+ \ oneline
+ \ skip="\%(\\\\\)*\\."
+ \ contains=vimSetEqual
+ \,vimOption
+ \,vimErrSetting
+ \,vimComment
+ \,vimSetString
+ \,vimSetMod
+endif