go.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. endif
  7. if !exists("g:go_highlight_functions")
  8. let g:go_highlight_functions = 0
  9. endif
  10. if g:go_highlight_functions != 0
  11. syn match goReceiver /(\(\w\|[ *]\)\+)/ contained nextgroup=goFunction contains=goReceiverOpen,goReceiverVar,goReceiverClose skipwhite skipnl
  12. syn match goReceiverOpen /(/ contained
  13. syn match goReceiverClose /)/ contained
  14. endif
  15. if !exists("g:go_highlight_types")
  16. let g:go_highlight_types = 0
  17. endif
  18. if g:go_highlight_types != 0
  19. syn match goTypeConstructor /\<\w\+{/he=e-1 contains=goTypeOpen
  20. syn match goTypeOpen /{/ contained
  21. " Redefine so interface and struct isn't falsely matched as a type constructor
  22. syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl
  23. endif
  24. hi link goReceiverOpen Operator
  25. hi link goReceiverClose Operator
  26. hi link goPointerOperator Operator
  27. hi link goTypeOpen Operator
  28. hi link goMethodCall Function
  29. hi link goFunctionCall Function