summaryrefslogtreecommitdiffstats
path: root/syntax/gomod.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-09-27 19:47:32 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-09-27 19:47:32 +0200
commitf95026252c5a31242903a98c741887696dfbb11f (patch)
treecd697cdc96c20a44f03ff3aacc67f78fdcc6ece5 /syntax/gomod.vim
parent4f3df59be709bf0d5c5c67dc804fde49abdc2700 (diff)
downloadvim-polyglot-f95026252c5a31242903a98c741887696dfbb11f.tar.gz
vim-polyglot-f95026252c5a31242903a98c741887696dfbb11f.zip
Update everything, closes #435
Diffstat (limited to 'syntax/gomod.vim')
-rw-r--r--syntax/gomod.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/syntax/gomod.vim b/syntax/gomod.vim
index 1d70e539..11cd7686 100644
--- a/syntax/gomod.vim
+++ b/syntax/gomod.vim
@@ -11,17 +11,20 @@ syntax case match
" match keywords
syntax keyword gomodModule module
+syntax keyword gomodGo go contained
syntax keyword gomodRequire require
syntax keyword gomodExclude exclude
syntax keyword gomodReplace replace
-" require, exclude and replace can be also grouped into block
+" require, exclude, replace, and go can be also grouped into block
syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion
syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion
syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion
+syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion
" set highlights
highlight default link gomodModule Keyword
+highlight default link gomodGo Keyword
highlight default link gomodRequire Keyword
highlight default link gomodExclude Keyword
highlight default link gomodReplace Keyword
@@ -38,6 +41,10 @@ highlight default link gomodString String
syntax match gomodReplaceOperator "\v\=\>"
highlight default link gomodReplaceOperator Operator
+" match go versions
+syntax match gomodGoVersion "1\.\d\+" contained
+highlight default link gomodGoVersion Identifier
+
" highlight versions:
" * vX.Y.Z-pre