summaryrefslogtreecommitdiffstats
path: root/syntax/go.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-01-23 21:09:23 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2015-01-23 21:09:23 +0100
commit6745c49110838db9ac39e85bbcf690b40bc20f83 (patch)
tree3b1c42f67bacb5ddb5b6afc5b4610f4c238877a7 /syntax/go.vim
parent1a97304cf642e9f887122e162b1999768b60c9d7 (diff)
downloadvim-polyglot-1.11.2.tar.gz
vim-polyglot-1.11.2.zip
Update all packagesv1.11.2
Diffstat (limited to 'syntax/go.vim')
-rw-r--r--syntax/go.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/syntax/go.vim b/syntax/go.vim
index 4ee39a71..7b0fbaf5 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -67,6 +67,10 @@ if !exists("g:go_highlight_structs")
let g:go_highlight_structs = 0
endif
+if !exists("g:go_highlight_build_constraints")
+ let g:go_highlight_build_constraints = 0
+endif
+
syn case match
syn keyword goDirective package import
@@ -270,6 +274,21 @@ endif
hi def link goStruct Function
hi def link goStructDef Function
+" Build Constraints
+if g:go_highlight_build_constraints != 0
+ syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows
+ syn keyword goBuildArch contained 386 amd64 amd64p32 arm
+ syn match goBuildDirective display contained "+build"
+ syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch
+ syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch
+endif
+
+hi def link goBuildComment Comment
+hi def link goBuildOs Type
+hi def link goBuildArch Type
+hi def link goBuildDirective PreProc
+
+
" Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/