go.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. if !exists("g:go_highlight_fields")
  2. let g:go_highlight_fields = 0
  3. endif
  4. if g:go_highlight_fields != 0
  5. syn match goField /\(\.\)\@<=\w\+\([.\ \n\r\)\[,]\)\@=/
  6. " Match fields in type constructors
  7. syn match goField /\([{, ]\|\s\)\@<=\w\+\(:\)\@=/
  8. endif
  9. if !exists("g:go_highlight_functions")
  10. let g:go_highlight_functions = 0
  11. endif
  12. if g:go_highlight_functions != 0
  13. syn match goReceiver /(\(\w\|[ *]\)\+)/ contained nextgroup=goFunction contains=goReceiverOpen,goReceiverVar,goReceiverClose skipwhite skipnl
  14. syn match goReceiverOpen /(/ contained
  15. syn match goReceiverClose /)/ contained
  16. endif
  17. if !exists("g:go_highlight_types")
  18. let g:go_highlight_types = 0
  19. endif
  20. if g:go_highlight_types != 0
  21. syn match goTypeConstructor /\<\w\+{/he=e-1 contains=goTypeOpen
  22. syn match goTypeOpen /{/ contained
  23. " Redefine so interface and struct isn't falsely matched as a type constructor
  24. syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
  25. endif
  26. hi link goReceiverOpen ContainerChars
  27. hi link goReceiverClose ContainerChars
  28. hi link goTypeOpen ContainerChars
  29. hi link goPointerOperator Operator
  30. hi link goMethodCall Function
  31. hi link goFunctionCall Function