espeakrules.vim 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. " Vim syntax file
  2. " Language: eSpeak Dictionary Rules Files
  3. " Filenames: *_rules
  4. " Maintainer: Reece H. Dunn <msclrhd@gmail.com>
  5. " Last Change: 2016 Sep 16
  6. " Quit when a (custom) syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " Replace region
  11. syn region espeakReplace start="^\.replace"hs=s+9 end="^\."me=e-2,he=e-2 contains=espeakReplaceKeyword,espeakComment nextgroup=espeakReplaceKeyword
  12. syn match espeakReplaceKeyword /^\.replace/ contained
  13. " Rule region
  14. syn region espeakRule start="^\.group"hs=s+6 end="^\."me=e-2,he=e-2 contains=espeakRuleGroupKeyword,espeakRuleName,espeakRuleLine,espeakKeyword,espeakComment nextgroup=espeaGroupName fold
  15. " One rule line in Rule region
  16. syn region espeakRuleLine start="^[^\.]" end="$" contains=espeak1Cols,espeak2Cols,espeak3Cols,espeak4Cols,espeak5Cols,espeakComment
  17. syn match espeakRuleCond /^?\!\{-}\d\+/ contained
  18. syn match espeakCharGroup /^\.L\d\{2}/
  19. syn match espeakCharGroup /L\d\{2}/ contained
  20. syn match espeakRuleSymbol /[@#&ABCDHFGKNVXYZ]/ contained
  21. syn match espeakRuleSpecial /[_\-\/&%+<]/ contained
  22. syn match espeakRulePrePoFix /[SP]\d\+/ contained
  23. syn match espeakRuleNote /\(\$w_alt\d*\|\$p_alt\d*\|$noprefix\)/ contained
  24. syn match espeakComment "//.*$" contains=espeakTodo
  25. syn match espeakComment "//.*$" contains=espeakTodo contained
  26. syn match espeakTodo /\(TODO\|FIXME\|\!\!\!\)/
  27. "syn match espeakError /^\s*\S\+/ contains=espeakComment
  28. syn match espeakRuleGroupKeyword /^\.group/ nextgroup=espeakGroupName contained
  29. syn match espeakGroupName /\s*\S\+/ nextgroup=espeakComment contained
  30. syn match espeak1Cols /^\s*\S\+/ contains=espeakComment contained
  31. syn match espeak2Cols /^\s*\S\+\s\+\S\+/ contains=espeakRuleCond,espeakRuleSpell,espeakCharGroup,espeakComment contained
  32. syn match espeak3Cols /^\s*\S\+\s\+\S\+\s\+\S\+/ contains=espeakRuleCond,espeakRulePre,espeakRulePos,espeakRuleSpell,espeakComment contained
  33. syn match espeak4Cols /^\s*\S\+\s\+\S\+\s\+\S\+\s\+\S\+/ contains=espeakRuleCond,espeakRulePre,espeakRulePos,espeakRuleSpell,espeakComment contained
  34. syn match espeak5Cols /^\s*\S\+\s\+\S\+\s\+\S\+\s\+\S\+\s\+\S\+/ contains=espeakRuleCond,espeakRulePre,espeakRulePos,espeakRuleSpell,espeakComment contained
  35. syn match espeakRulePre /\S\+)/ contains=espeakCharGroup,espeakRuleSymbol,espeakRuleSpecial contained
  36. syn match espeakRulePos /\s*(\S\+/ contains=espeakCharGroup,espeakRulePrePoFix,espeakRuleNote,espeakRuleSymbol,espeakRuleSpecial contained
  37. " Define the default highlighting.
  38. " Only used when an item doesn't have highlighting yet
  39. hi link espeakReplace String
  40. hi link espeakRuleName Statement
  41. hi link espeakReplaceKeyword Statement
  42. hi link espeakRuleGroupKeyword Keyword
  43. hi link espeakRuleSpecial espeakRuleHiglight
  44. hi link espeakRuleNote espeakRuleHiglight
  45. hi link espeakRuleCond espeakRuleHiglight
  46. hi link espeakRulePrePoFix Keyword
  47. hi link espeakGroupName Character
  48. hi link espeakCharGroup espeakRuleDarklight
  49. hi link espeakRuleSymbol Special
  50. hi link espeak1Cols String
  51. hi link espeak2Cols String
  52. hi link espeak3Cols String
  53. hi link espeak4Cols String
  54. hi link espeak5Cols String
  55. hi link espeakRulePre Identifier
  56. hi link espeakRulePos Identifier
  57. hi link espeakError Error
  58. hi link espeakKeyword Keyword
  59. hi link espeakComment Comment
  60. hi link espeakTodo Todo
  61. hi espeakRuleHiglight guifg=magenta
  62. hi espeakRuleDarklight guifg=darkmagenta
  63. let b:current_syntax = "espeakrules"
  64. " vim: ts=8
  65. "