3 " Maintainer : Christian V. J. Brüssow <cvjb@bigfoot.de>
4 " Last change: Son 06 Mai 2001 20:33:13 CEST
6 " Lout: Basser Lout document formatting system.
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
12 elseif exists("b:current_syntax")
16 " Lout is case sensitive
19 " Synchronization, I know it is a huge number, but normal texts can be
23 " Characters allowed in keywords
24 " I don't know if 128-255 are allowed in ANS-FORHT
26 setlocal iskeyword=@,48-57,.,@-@,_,192-255
28 set iskeyword=@,48-57,.,@-@,_,192-255
31 " Some special keywords
32 syn keyword loutTodo contained TODO lout Lout LOUT
33 syn keyword loutDefine def macro
36 syn keyword loutKeyword @Begin @End @Figure @Tab
37 syn keyword loutKeyword @Book @Doc @Document @Report
38 syn keyword loutKeyword @Introduction @Abstract @Appendix
39 syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
41 " All kind of Lout keywords
42 syn match loutFunction '\<@[^ \t{}]\+\>'
44 " Braces -- Don`t edit these lines!
45 syn match loutMBraces '[{}]'
46 syn match loutIBraces '[{}]'
47 syn match loutBBrace '[{}]'
48 syn match loutBIBraces '[{}]'
49 syn match loutHeads '[{}]'
52 syn match loutBraceError '}'
54 " End of multi-line definitions, like @Document, @Report and @Book.
55 syn match loutEOmlDef '^//$'
57 " Grouping of parameters and objects.
58 syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
60 " The NULL object has a special meaning
61 syn keyword loutNULL {}
64 syn region loutComment start='\#' end='$' contains=loutTodo
67 syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
69 " ISO-LATIN-1 characters created with @Char, or Adobe symbols
71 syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
74 syn match loutInclude '@IncludeGraphic\s\+\k\+'
75 syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
78 syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
79 syn region loutTag start='@Tag\s*{' end='}'
82 syn match loutMath '@Eq\s\+\k\+'
83 syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
86 syn match loutItalic '@I\s\+\k\+'
87 syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
88 syn match loutBold '@B\s\+\k\+'
89 syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
90 syn match loutBoldItalic '@BI\s\+\k\+'
91 syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
92 syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
94 " Define the default highlighting.
95 " For version 5.7 and earlier: only when not done already
96 " For version 5.8 and later: only when an item doesn't have highlighting yet
97 if version >= 508 || !exists("did_lout_syn_inits")
99 let did_lout_syn_inits = 1
100 command -nargs=+ HiLink hi link <args>
102 command -nargs=+ HiLink hi def link <args>
105 " The default methods for highlighting. Can be overrriden later.
107 HiLink loutDefine Define
108 HiLink loutEOmlDef Define
109 HiLink loutFunction Function
110 HiLink loutBraceError Error
111 HiLink loutNULL Special
112 HiLink loutComment Comment
113 HiLink loutSpecial Special
114 HiLink loutSymbols Character
115 HiLink loutInclude Include
116 HiLink loutKeyword Keyword
118 HiLink loutMath Number
120 " HiLink Not really needed here, but I think it is more consistent.
121 HiLink loutMBraces loutMath
122 hi loutItalic term=italic cterm=italic gui=italic
123 HiLink loutIBraces loutItalic
124 hi loutBold term=bold cterm=bold gui=bold
125 HiLink loutBBraces loutBold
126 hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
127 HiLink loutBIBraces loutBoldItalic
128 hi loutHeadings term=bold cterm=bold guifg=indianred
129 HiLink loutHeads loutHeadings
134 let b:current_syntax = "lout"