sgmllnx.vim 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. " Vim syntax file
  2. " Language: SGML-linuxdoc (supported by old sgmltools-1.x)
  3. " Maintainer: SungHyun Nam <goweol@gmail.com>
  4. " Last Change: 2013 May 13
  5. " quit when a syntax file was already loaded
  6. if exists("b:current_syntax")
  7. finish
  8. endif
  9. syn case ignore
  10. " tags
  11. syn region sgmllnxEndTag start=+</+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
  12. syn region sgmllnxTag start=+<[^/]+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
  13. syn match sgmllnxTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=sgmllnxTagName
  14. syn match sgmllnxTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=sgmllnxTagName
  15. syn region sgmllnxTag2 start=+<\s*[a-zA-Z]\+/+ keepend end=+/+ contains=sgmllnxTagN2
  16. syn match sgmllnxTagN2 contained +/.*/+ms=s+1,me=e-1
  17. syn region sgmllnxSpecial oneline start="&" end=";"
  18. " tag names
  19. syn keyword sgmllnxTagName contained article author date toc title sect verb
  20. syn keyword sgmllnxTagName contained abstract tscreen p itemize item enum
  21. syn keyword sgmllnxTagName contained descrip quote htmlurl code ref
  22. syn keyword sgmllnxTagName contained tt tag bf it url
  23. syn match sgmllnxTagName contained "sect\d\+"
  24. " Comments
  25. syn region sgmllnxComment start=+<!--+ end=+-->+
  26. syn region sgmllnxDocType start=+<!doctype+ end=+>+
  27. " Define the default highlighting.
  28. " Only when an item doesn't have highlighting yet
  29. hi def link sgmllnxTag2 Function
  30. hi def link sgmllnxTagN2 Function
  31. hi def link sgmllnxTag Special
  32. hi def link sgmllnxEndTag Special
  33. hi def link sgmllnxParen Special
  34. hi def link sgmllnxEntity Type
  35. hi def link sgmllnxDocEnt Type
  36. hi def link sgmllnxTagName Statement
  37. hi def link sgmllnxComment Comment
  38. hi def link sgmllnxSpecial Special
  39. hi def link sgmllnxDocType PreProc
  40. hi def link sgmllnxTagError Error
  41. let b:current_syntax = "sgmllnx"
  42. " vim:set tw=78 ts=8 sts=2 sw=2 noet: