Add vim support for highlighting GN target names
For GN files, let the target name stand out from the directory path to
the BUILD file. For example, a dependency that looks like
"//base/foo:bar" will color ':bar' distinctly from the rest of the
string (using the 'Special' highlighting group).
BUG=
Review-Url: https://codereview.chromium.org/2672573002
Cr-Original-Commit-Position: refs/heads/master@{#447670}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 809b8f0ca34beae53da551347d4281cb2da386c9
diff --git a/tools/gn/misc/vim/syntax/gn.vim b/tools/gn/misc/vim/syntax/gn.vim
index 55f1852..0fbd6e0 100644
--- a/tools/gn/misc/vim/syntax/gn.vim
+++ b/tools/gn/misc/vim/syntax/gn.vim
@@ -52,8 +52,10 @@
hi def link gnVariable Keyword
" Strings
-syn region gnString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
+syn region gnString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,gnTargetName
+syn match gnTargetName '\v:[^"]+' contained
hi def link gnString String
+hi def link gnTargetName Special
" Comments
syn keyword gnTodo contained TODO FIXME XXX BUG NOTE