hb.vim 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. " Vim syntax file
  2. " Language: Hyper Builder
  3. " Maintainer: Alejandro Forero Cuervo
  4. " URL: http://bachue.com/hb/vim/syntax/hb.vim
  5. " Last Change: 2012 Jan 08 by Thilo Six
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. " Read the HTML syntax to start with
  13. "syn include @HTMLStuff <sfile>:p:h/htmlhb.vim
  14. "this would be nice but we are supposed not to do it
  15. "set mps=<:>
  16. "syn region HBhtmlString contained start=+"+ end=+"+ contains=htmlSpecialChar
  17. "syn region HBhtmlString contained start=+'+ end=+'+ contains=htmlSpecialChar
  18. "syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"
  19. syn match htmlSpecialChar "&[^;]*;" contained
  20. syn match HBhtmlTagSk contained "[A-Za-z]*"
  21. syn match HBhtmlTagS contained "<\s*\(hb\s*\.\s*\(sec\|min\|hour\|day\|mon\|year\|input\|html\|time\|getcookie\|streql\|url-enc\)\|wall\s*\.\s*\(show\|info\|id\|new\|rm\|count\)\|auth\s*\.\s*\(chk\|add\|find\|user\)\|math\s*\.\s*exp\)\s*\([^.A-Za-z0-9]\|$\)" contains=HBhtmlTagSk transparent
  22. syn match HBhtmlTagN contained "[A-Za-z0-9\/\-]\+"
  23. syn match HBhtmlTagB contained "<\s*[A-Za-z0-9\/\-]\+\(\s*\.\s*[A-Za-z0-9\/\-]\+\)*" contains=HBhtmlTagS,HBhtmlTagN
  24. syn region HBhtmlTag contained start=+<+ end=+>+ contains=HBhtmlTagB,HBDirectiveError
  25. syn match HBFileName ".*" contained
  26. syn match HBDirectiveKeyword ":\s*\(include\|lib\|set\|out\)\s\+" contained
  27. syn match HBDirectiveError "^:.*$" contained
  28. "syn match HBDirectiveBlockEnd "^:\s*$" contained
  29. "syn match HBDirectiveOutHead "^:\s*out\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
  30. "syn match HBDirectiveSetHead "^:\s*set\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
  31. syn match HBInvalidLine "^.*$"
  32. syn match HBDirectiveInclude "^:\s*include\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
  33. syn match HBDirectiveLib "^:\s*lib\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
  34. syn region HBText matchgroup=HBDirectiveKeyword start=/^:\(set\|out\)\s*\S\+.*$/ end=/^:\s*$/ contains=HBDirectiveError,htmlSpecialChar,HBhtmlTag keepend
  35. "syn match HBLine "^:.*$" contains=HBDirectiveInclude,HBDirectiveLib,HBDirectiveError,HBDirectiveSet,HBDirectiveOut
  36. syn match HBComment "^#.*$"
  37. " Define the default highlighting.
  38. " Only when an item doesn't have highlighting yet
  39. hi def link HBhtmlString String
  40. hi def link HBhtmlTagN Function
  41. hi def link htmlSpecialChar String
  42. hi def link HBInvalidLine Error
  43. hi def link HBFoobar Comment
  44. hi HBFileName guibg=lightgray guifg=black
  45. hi def link HBDirectiveError Error
  46. hi def link HBDirectiveBlockEnd HBDirectiveKeyword
  47. hi HBDirectiveKeyword guibg=lightgray guifg=darkgreen
  48. hi def link HBComment Comment
  49. hi def link HBhtmlTagSk Statement
  50. syn sync match Normal grouphere NONE "^:\s*$"
  51. syn sync match Normal grouphere NONE "^:\s*lib\s\+[^ \t]\+$"
  52. syn sync match Normal grouphere NONE "^:\s*include\s\+[^ \t]\+$"
  53. "syn sync match Block grouphere HBDirectiveSet "^#:\s*set\s\+[^ \t]\+"
  54. "syn sync match Block grouphere HBDirectiveOut "^#:\s*out\s\+[^ \t]\+"
  55. let b:current_syntax = "hb"
  56. let &cpo = s:cpo_save
  57. unlet s:cpo_save
  58. " vim: ts=8