lout.vim 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. " Vim syntax file
  2. " Language: Lout
  3. " Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
  4. " Last Change: So 12 Feb 2012 15:15:03 CET
  5. " Filenames: *.lout,*.lt
  6. " URL: http://www.cvjb.de/comp/vim/lout.vim
  7. " $Id: lout.vim,v 1.4 2012/02/12 15:16:17 bruessow Exp $
  8. "
  9. " Lout: Basser Lout document formatting system.
  10. " Many Thanks to...
  11. "
  12. " 2012-02-12:
  13. " Thilo Six <T.Six at gmx dot de> send a patch for cpoptions.
  14. " See the discussion at http://thread.gmane.org/gmane.editors.vim.devel/32151
  15. " quit when a syntax file was already loaded
  16. if exists("b:current_syntax")
  17. finish
  18. endif
  19. let s:cpo_save=&cpo
  20. set cpo&vim
  21. " Lout is case sensitive
  22. syn case match
  23. " Synchronization, I know it is a huge number, but normal texts can be
  24. " _very_ long ;-)
  25. syn sync lines=1000
  26. " Characters allowed in keywords
  27. " I don't know if 128-255 are allowed in ANS-FORHT
  28. setlocal iskeyword=@,48-57,.,@-@,_,192-255
  29. " Some special keywords
  30. syn keyword loutTodo contained TODO lout Lout LOUT
  31. syn keyword loutDefine def macro
  32. " Some big structures
  33. syn keyword loutKeyword @Begin @End @Figure @Tab
  34. syn keyword loutKeyword @Book @Doc @Document @Report
  35. syn keyword loutKeyword @Introduction @Abstract @Appendix
  36. syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
  37. " All kind of Lout keywords
  38. syn match loutFunction '\<@[^ \t{}]\+\>'
  39. " Braces -- Don`t edit these lines!
  40. syn match loutMBraces '[{}]'
  41. syn match loutIBraces '[{}]'
  42. syn match loutBBrace '[{}]'
  43. syn match loutBIBraces '[{}]'
  44. syn match loutHeads '[{}]'
  45. " Unmatched braces.
  46. syn match loutBraceError '}'
  47. " End of multi-line definitions, like @Document, @Report and @Book.
  48. syn match loutEOmlDef '^//$'
  49. " Grouping of parameters and objects.
  50. syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
  51. " The NULL object has a special meaning
  52. syn keyword loutNULL {}
  53. " Comments
  54. syn region loutComment start='\#' end='$' contains=loutTodo
  55. " Double quotes
  56. syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
  57. " ISO-LATIN-1 characters created with @Char, or Adobe symbols
  58. " created with @Sym
  59. syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
  60. " Include files
  61. syn match loutInclude '@IncludeGraphic\s\+\k\+'
  62. syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
  63. " Tags
  64. syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
  65. syn region loutTag start='@Tag\s*{' end='}'
  66. " Equations
  67. syn match loutMath '@Eq\s\+\k\+'
  68. syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
  69. "
  70. " Fonts
  71. syn match loutItalic '@I\s\+\k\+'
  72. syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
  73. syn match loutBold '@B\s\+\k\+'
  74. syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
  75. syn match loutBoldItalic '@BI\s\+\k\+'
  76. syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
  77. syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
  78. " Define the default highlighting.
  79. " Only when an item doesn't have highlighting yet
  80. " The default methods for highlighting. Can be overrriden later.
  81. hi def link loutTodo Todo
  82. hi def link loutDefine Define
  83. hi def link loutEOmlDef Define
  84. hi def link loutFunction Function
  85. hi def link loutBraceError Error
  86. hi def link loutNULL Special
  87. hi def link loutComment Comment
  88. hi def link loutSpecial Special
  89. hi def link loutSymbols Character
  90. hi def link loutInclude Include
  91. hi def link loutKeyword Keyword
  92. hi def link loutTag Tag
  93. hi def link loutMath Number
  94. hi def link loutMBraces loutMath
  95. hi loutItalic term=italic cterm=italic gui=italic
  96. hi def link loutIBraces loutItalic
  97. hi loutBold term=bold cterm=bold gui=bold
  98. hi def link loutBBraces loutBold
  99. hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
  100. hi def link loutBIBraces loutBoldItalic
  101. hi loutHeadings term=bold cterm=bold guifg=indianred
  102. hi def link loutHeads loutHeadings
  103. let b:current_syntax = "lout"
  104. let &cpo=s:cpo_save
  105. unlet s:cpo_save
  106. " vim:ts=8:sw=4:nocindent:smartindent: