Skip to content

Commit

Permalink
feat: support retract as keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
johejo committed Feb 7, 2021
1 parent 7860ecf commit 1e67879
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions syntax/gomod.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ syntax keyword gomodGo go contained
syntax keyword gomodRequire require
syntax keyword gomodExclude exclude
syntax keyword gomodReplace replace
syntax keyword gomodRetract retract

" 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
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 region gomodRetract start='retract \[' end='\]' transparent contains=gomodRetract,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
highlight default link gomodRetract Keyword

" comments are always in form of // ...
syntax region gomodComment start="//" end="$" contains=@Spell
Expand Down

0 comments on commit 1e67879

Please sign in to comment.