home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / dos / syntax / lout.vim < prev    next >
Encoding:
Text File  |  2012-05-31  |  4.8 KB  |  154 lines

  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.  
  8. " $Id: lout.vim,v 1.4 2012/02/12 15:16:17 bruessow Exp $
  9. "
  10. " Lout: Basser Lout document formatting system.
  11.  
  12. " Many Thanks to...
  13. " 2012-02-12:
  14. " Thilo Six <T.Six at gmx dot de> send a patch for cpoptions.
  15. " See the discussion at http://thread.gmane.org/gmane.editors.vim.devel/32151
  16.  
  17.  
  18. " For version 5.x: Clear all syntax items
  19. " For version 6.x: Quit when a syntax file was already loaded
  20. if version < 600
  21.     syntax clear
  22. elseif exists("b:current_syntax")
  23.     finish
  24. endif
  25.  
  26. let s:cpo_save=&cpo
  27. set cpo&vim
  28.  
  29. " Lout is case sensitive
  30. syn case match
  31.  
  32. " Synchronization, I know it is a huge number, but normal texts can be
  33. " _very_ long ;-)
  34. syn sync lines=1000
  35.  
  36. " Characters allowed in keywords
  37. " I don't know if 128-255 are allowed in ANS-FORHT
  38. if version >= 600
  39.     setlocal iskeyword=@,48-57,.,@-@,_,192-255
  40. else
  41.     set iskeyword=@,48-57,.,@-@,_,192-255
  42. endif
  43.  
  44. " Some special keywords
  45. syn keyword loutTodo contained TODO lout Lout LOUT
  46. syn keyword loutDefine def macro
  47.  
  48. " Some big structures
  49. syn keyword loutKeyword @Begin @End @Figure @Tab
  50. syn keyword loutKeyword @Book @Doc @Document @Report
  51. syn keyword loutKeyword @Introduction @Abstract @Appendix
  52. syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
  53.  
  54. " All kind of Lout keywords
  55. syn match loutFunction '\<@[^ \t{}]\+\>'
  56.  
  57. " Braces -- Don`t edit these lines!
  58. syn match loutMBraces '[{}]'
  59. syn match loutIBraces '[{}]'
  60. syn match loutBBrace '[{}]'
  61. syn match loutBIBraces '[{}]'
  62. syn match loutHeads '[{}]'
  63.  
  64. " Unmatched braces.
  65. syn match loutBraceError '}'
  66.  
  67. " End of multi-line definitions, like @Document, @Report and @Book.
  68. syn match loutEOmlDef '^//$'
  69.  
  70. " Grouping of parameters and objects.
  71. syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
  72.  
  73. " The NULL object has a special meaning
  74. syn keyword loutNULL {}
  75.  
  76. " Comments
  77. syn region loutComment start='\#' end='$' contains=loutTodo
  78.  
  79. " Double quotes
  80. syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
  81.  
  82. " ISO-LATIN-1 characters created with @Char, or Adobe symbols
  83. " created with @Sym
  84. syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
  85.  
  86. " Include files
  87. syn match loutInclude '@IncludeGraphic\s\+\k\+'
  88. syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
  89.  
  90. " Tags
  91. syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
  92. syn region loutTag start='@Tag\s*{' end='}'
  93.  
  94. " Equations
  95. syn match loutMath '@Eq\s\+\k\+'
  96. syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
  97. "
  98. " Fonts
  99. syn match loutItalic '@I\s\+\k\+'
  100. syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
  101. syn match loutBold '@B\s\+\k\+'
  102. syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
  103. syn match loutBoldItalic '@BI\s\+\k\+'
  104. syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
  105. syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
  106.  
  107. " Define the default highlighting.
  108. " For version 5.7 and earlier: only when not done already
  109. " For version 5.8 and later: only when an item doesn't have highlighting yet
  110. if version >= 508 || !exists("did_lout_syn_inits")
  111.     if version < 508
  112.         let did_lout_syn_inits = 1
  113.         command -nargs=+ HiLink hi link <args>
  114.     else
  115.         command -nargs=+ HiLink hi def link <args>
  116.     endif
  117.  
  118.     " The default methods for highlighting. Can be overrriden later.
  119.     HiLink loutTodo Todo
  120.     HiLink loutDefine Define
  121.     HiLink loutEOmlDef Define
  122.     HiLink loutFunction Function
  123.     HiLink loutBraceError Error
  124.     HiLink loutNULL Special
  125.     HiLink loutComment Comment
  126.     HiLink loutSpecial Special
  127.     HiLink loutSymbols Character
  128.     HiLink loutInclude Include
  129.     HiLink loutKeyword Keyword
  130.     HiLink loutTag Tag
  131.     HiLink loutMath Number
  132.  
  133.     " HiLink Not really needed here, but I think it is more consistent.
  134.     HiLink loutMBraces loutMath
  135.     hi loutItalic term=italic cterm=italic gui=italic
  136.     HiLink loutIBraces loutItalic
  137.     hi loutBold term=bold cterm=bold gui=bold
  138.     HiLink loutBBraces loutBold
  139.     hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
  140.     HiLink loutBIBraces loutBoldItalic
  141.     hi loutHeadings term=bold cterm=bold guifg=indianred
  142.     HiLink loutHeads loutHeadings
  143.  
  144.     delcommand HiLink
  145. endif
  146.  
  147. let b:current_syntax = "lout"
  148.  
  149. let &cpo=s:cpo_save
  150. unlet s:cpo_save
  151.  
  152. " vim:ts=8:sw=4:nocindent:smartindent:
  153.