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