wml.vim 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. " Vim syntax file
  2. " Language: WML - Website MetaLanguage
  3. " Maintainer: Gerfried Fuchs <alfie@ist.org>
  4. " Filenames: *.wml
  5. " Last Change: 07 Feb 2002
  6. " URL: http://alfie.ist.org/software/vim/syntax/wml.vim
  7. "
  8. " Original Version: Craig Small <csmall@eye-net.com.au>
  9. " Comments are very welcome - but please make sure that you are commenting on
  10. " the latest version of this file.
  11. " SPAM is _NOT_ welcome - be ready to be reported!
  12. " If you are looking for the "Wireless Markup Language" syntax file,
  13. " please take a look at the wap.vim file done by Ralf Schandl, soon in a
  14. " vim-package around your corner :)
  15. " quit when a syntax file was already loaded
  16. if exists("b:current_syntax")
  17. finish
  18. endif
  19. " A lot of the web stuff looks like HTML so we load that first
  20. runtime! syntax/html.vim
  21. unlet b:current_syntax
  22. if !exists("main_syntax")
  23. let main_syntax = 'wml'
  24. endif
  25. " special character
  26. syn match wmlNextLine "\\$"
  27. " Redfine htmlTag
  28. syn clear htmlTag
  29. syn region htmlTag start=+<[^/<]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition
  30. "
  31. " Add in extra Arguments used by wml
  32. syn keyword htmlTagName contained gfont imgbg imgdot lowsrc
  33. syn keyword htmlTagName contained navbar:define navbar:header
  34. syn keyword htmlTagName contained navbar:footer navbar:prolog
  35. syn keyword htmlTagName contained navbar:epilog navbar:button
  36. syn keyword htmlTagName contained navbar:filter navbar:debug
  37. syn keyword htmlTagName contained navbar:render
  38. syn keyword htmlTagName contained preload rollover
  39. syn keyword htmlTagName contained space hspace vspace over
  40. syn keyword htmlTagName contained ps ds pi ein big sc spaced headline
  41. syn keyword htmlTagName contained ue subheadline zwue verbcode
  42. syn keyword htmlTagName contained isolatin pod sdf text url verbatim
  43. syn keyword htmlTagName contained xtable
  44. syn keyword htmlTagName contained csmap fsview import box
  45. syn keyword htmlTagName contained case:upper case:lower
  46. syn keyword htmlTagName contained grid cell info lang: logo page
  47. syn keyword htmlTagName contained set-var restore
  48. syn keyword htmlTagName contained array:push array:show set-var ifdef
  49. syn keyword htmlTagName contained say m4 symbol dump enter divert
  50. syn keyword htmlTagName contained toc
  51. syn keyword htmlTagName contained wml card do refresh oneevent catch spawn
  52. "
  53. " The wml arguments
  54. syn keyword htmlArg contained adjust background base bdcolor bdspace
  55. syn keyword htmlArg contained bdwidth complete copyright created crop
  56. syn keyword htmlArg contained direction description domainname eperlfilter
  57. syn keyword htmlArg contained file hint imgbase imgstar interchar interline
  58. syn keyword htmlArg contained keephr keepindex keywords layout spacing
  59. syn keyword htmlArg contained padding nonetscape noscale notag notypo
  60. syn keyword htmlArg contained onload oversrc pos select slices style
  61. syn keyword htmlArg contained subselected txtcol_select txtcol_normal
  62. syn keyword htmlArg contained txtonly via
  63. syn keyword htmlArg contained mode columns localsrc ordered
  64. " Lines starting with an # are usually comments
  65. syn match wmlComment "^\s*#.*"
  66. " The different exceptions to comments
  67. syn match wmlSharpBang "^#!.*"
  68. syn match wmlUsed contained "\s\s*[A-Za-z:_-]*"
  69. syn match wmlUse "^\s*#\s*use\s\+" contains=wmlUsed
  70. syn match wmlInclude "^\s*#\s*include.+"
  71. syn region wmlBody contained start=+<<+ end=+>>+
  72. syn match wmlLocationId contained "[A-Za-z]\+"
  73. syn region wmlLocation start=+<<+ end=+>>+ contains=wmlLocationId
  74. "syn region wmlLocation start=+{#+ end=+#}+ contains=wmlLocationId
  75. "syn region wmlLocationed contained start=+<<+ end=+>>+ contains=wmlLocationId
  76. syn match wmlDivert "\.\.[a-zA-Z_]\+>>"
  77. syn match wmlDivertEnd "<<\.\."
  78. " new version
  79. "syn match wmlDivert "{#[a-zA-Z_]\+#:"
  80. "syn match wmlDivertEnd ":##}"
  81. syn match wmlDefineName contained "\s\+[A-Za-z-]\+"
  82. syn region htmlTagName start="\<\(define-tag\|define-region\)" end="\>" contains=wmlDefineName
  83. " The perl include stuff
  84. if main_syntax != 'perl'
  85. " Perl script
  86. syn include @wmlPerlScript syntax/perl.vim
  87. unlet b:current_syntax
  88. syn region perlScript start=+<perl>+ keepend end=+</perl>+ contains=@wmlPerlScript,wmlPerlTag
  89. " eperl between '<:' and ':>' -- Alfie [1999-12-26]
  90. syn region perlScript start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag
  91. syn match wmlPerlTag contained "</*perl>" contains=wmlPerlTagN
  92. syn keyword wmlPerlTagN contained perl
  93. hi link wmlPerlTag htmlTag
  94. hi link wmlPerlTagN htmlStatement
  95. endif
  96. " verbatim tags -- don't highlight anything in between -- Alfie [2002-02-07]
  97. syn region wmlVerbatimText start=+<verbatim>+ keepend end=+</verbatim>+ contains=wmlVerbatimTag
  98. syn match wmlVerbatimTag contained "</*verbatim>" contains=wmlVerbatimTagN
  99. syn keyword wmlVerbatimTagN contained verbatim
  100. hi link wmlVerbatimTag htmlTag
  101. hi link wmlVerbatimTagN htmlStatement
  102. if main_syntax == "html"
  103. syn sync match wmlHighlight groupthere NONE "</a-zA-Z]"
  104. syn sync match wmlHighlight groupthere perlScript "<perl>"
  105. syn sync match wmlHighlightSkip "^.*['\"].*$"
  106. syn sync minlines=10
  107. endif
  108. " Define the default highlighting.
  109. " Only when an item doesn't have highlighting yet
  110. hi def link wmlNextLine Special
  111. hi def link wmlUse Include
  112. hi def link wmlUsed String
  113. hi def link wmlBody Special
  114. hi def link wmlDiverted Label
  115. hi def link wmlDivert Delimiter
  116. hi def link wmlDivertEnd Delimiter
  117. hi def link wmlLocationId Label
  118. hi def link wmlLocation Delimiter
  119. " hi def link wmlLocationed Delimiter
  120. hi def link wmlDefineName String
  121. hi def link wmlComment Comment
  122. hi def link wmlInclude Include
  123. hi def link wmlSharpBang PreProc
  124. let b:current_syntax = "wml"