webmacro.vim 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. " WebMacro syntax file
  2. " Language: WebMacro
  3. " Maintainer: Claudio Fleiner <claudio@fleiner.com>
  4. " URL: http://www.fleiner.com/vim/syntax/webmacro.vim
  5. " Last Change: 2003 May 11
  6. " webmacro is a nice little language that you should
  7. " check out if you use java servlets.
  8. " webmacro: http://www.webmacro.org
  9. " For version 5.x: Clear all syntax items
  10. " For version 6.x: Quit when a syntax file was already loaded
  11. if !exists("main_syntax")
  12. " quit when a syntax file was already loaded
  13. if exists("b:current_syntax")
  14. finish
  15. endif
  16. let main_syntax = 'webmacro'
  17. endif
  18. runtime! syntax/html.vim
  19. unlet b:current_syntax
  20. syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment
  21. syn match webmacroVariable "\$[a-zA-Z0-9.()]*;\="
  22. syn match webmacroNumber "[-+]\=\d\+[lL]\=" contained
  23. syn keyword webmacroBoolean true false contained
  24. syn match webmacroSpecial "\\." contained
  25. syn region webmacroString contained start=+"+ end=+"+ contains=webmacroSpecial,webmacroVariable
  26. syn region webmacroString contained start=+'+ end=+'+ contains=webmacroSpecial,webmacroVariable
  27. syn region webmacroList contained matchgroup=Structure start="\[" matchgroup=Structure end="\]" contains=webmacroString,webmacroVariable,webmacroNumber,webmacroBoolean,webmacroList
  28. syn region webmacroIf start="#if" start="#else" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
  29. syn region webmacroForeach start="#foreach" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
  30. syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
  31. syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
  32. syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
  33. syn region webmacroUse matchgroup=PreProc start="#use .*" matchgroup=PreProc end="^-.*" contains=webmacroHash,@HtmlTop
  34. syn region webmacroBraces matchgroup=Structure start="{" matchgroup=Structure end="}" contained transparent
  35. syn match webmacroBracesError "[{}]"
  36. syn match webmacroComment "##.*$"
  37. syn match webmacroHash "[#{}\$]" contained
  38. " Define the default highlighting.
  39. " Only when an item doesn't have highlighting yet
  40. hi def link webmacroComment CommentTitle
  41. hi def link webmacroVariable PreProc
  42. hi def link webmacroIf webmacroStatement
  43. hi def link webmacroForeach webmacroStatement
  44. hi def link webmacroSet webmacroStatement
  45. hi def link webmacroInclude webmacroStatement
  46. hi def link webmacroParse webmacroStatement
  47. hi def link webmacroStatement Function
  48. hi def link webmacroNumber Number
  49. hi def link webmacroBoolean Boolean
  50. hi def link webmacroSpecial Special
  51. hi def link webmacroString String
  52. hi def link webmacroBracesError Error
  53. let b:current_syntax = "webmacro"
  54. if main_syntax == 'webmacro'
  55. unlet main_syntax
  56. endif