comparison runtime/syntax/initex.vim @ 837:6bb1fa855dc9 v7.0e03

updated for version 7.0e03
author vimboss
date Wed, 19 Apr 2006 21:23:36 +0000
parents
children 1218c5353e2b
comparison
equal deleted inserted replaced
836:5a7843c57316 837:6bb1fa855dc9
1 " Vim syntax file
2 " Language: TeX (core definition)
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2006-04-19
5
6 if exists("b:current_syntax")
7 finish
8 endif
9
10 let s:cpo_save = &cpo
11 set cpo&vim
12
13 " This follows the grouping (sort of) found at
14 " http://www.tug.org/utilities/plain/cseq.html#top-fam
15
16 syn keyword initexTodo TODO FIXME XXX NOTE
17
18 syn match initexComment display contains=initexTodo
19 \ '\\\@<!\%(\\\\\)*\zs%.*$'
20
21 syn match initexDimension display contains=@NoSpell
22 \ '[+-]\=\s*\%(\d\+\%([.,]\d*\)\=\|[.,]\d\+\)\s*\%(true\)\=\s*\%(p[tc]\|in\|bp\|c[mc]\|m[mu]\|dd\|sp\|e[mx]\)\>'
23
24 syn cluster initexBox
25 \ contains=initexBoxCommand,initexBoxInternalQuantity,
26 \ initexBoxParameterDimen,initexBoxParameterInteger,
27 \ initexBoxParameterToken
28
29 syn cluster initexCharacter
30 \ contains=initexCharacterCommand,initexCharacterInternalQuantity,
31 \ initexCharacterParameterInteger
32
33 syn cluster initexDebugging
34 \ contains=initexDebuggingCommand,initexDebuggingParameterInteger,
35 \ initexDebuggingParameterToken
36
37 syn cluster initexFileIO
38 \ contains=initexFileIOCommand,initexFileIOInternalQuantity,
39 \ initexFileIOParameterToken
40
41 syn cluster initexFonts
42 \ contains=initexFontsCommand,initexFontsInternalQuantity
43
44 syn cluster initexGlue
45 \ contains=initexGlueCommand,initexGlueDerivedCommand
46
47 syn cluster initexHyphenation
48 \ contains=initexHyphenationCommand,initexHyphenationDerivedCommand,
49 \ initexHyphenationInternalQuantity,initexHyphenationParameterInteger
50
51 syn cluster initexInserts
52 \ contains=initexInsertsCommand,initexInsertsParameterDimen,
53 \ initexInsertsParameterGlue,initexInsertsParameterInteger
54
55 syn cluster initexJob
56 \ contains=initexJobCommand,initexJobInternalQuantity,
57 \ initexJobParameterInteger
58
59 syn cluster initexKern
60 \ contains=initexKernCommand,initexKernInternalQuantity
61
62 syn cluster initexLogic
63 \ contains=initexLogicCommand
64
65 syn cluster initexMacro
66 \ contains=initexMacroCommand,initexMacroDerivedCommand,
67 \ initexMacroParameterInteger
68
69 syn cluster initexMarks
70 \ contains=initexMarksCommand
71
72 syn cluster initexMath
73 \ contains=initexMathCommand,initexMathDerivedCommand,
74 \ initexMathInternalQuantity,initexMathParameterDimen,
75 \ initexMathParameterGlue,initexMathParameterInteger,
76 \ initexMathParameterMuglue,initexMathParameterToken
77
78 syn cluster initexPage
79 \ contains=initexPageInternalQuantity,initexPageParameterDimen,
80 \ initexPageParameterGlue
81
82 syn cluster initexParagraph
83 \ contains=initexParagraphCommand,initexParagraphInternalQuantity,
84 \ initexParagraphParameterDimen,initexParagraphParameterGlue,
85 \ initexParagraphParameterInteger,initexParagraphParameterToken
86
87 syn cluster initexPenalties
88 \ contains=initexPenaltiesCommand,initexPenaltiesInternalQuantity,
89 \ initexPenaltiesParameterInteger
90
91 syn cluster initexRegisters
92 \ contains=initexRegistersCommand,initexRegistersInternalQuantity
93
94 syn cluster initexTables
95 \ contains=initexTablesCommand,initexTablesParameterGlue,
96 \ initexTablesParameterToken
97
98 syn cluster initexCommand
99 \ contains=initexBoxCommand,initexCharacterCommand,
100 \ initexDebuggingCommand,initexFileIOCommand,
101 \ initexFontsCommand,initexGlueCommand,
102 \ initexHyphenationCommand,initexInsertsCommand,
103 \ initexJobCommand,initexKernCommand,initexLogicCommand,
104 \ initexMacroCommand,initexMarksCommand,initexMathCommand,
105 \ initexParagraphCommand,initexPenaltiesCommand,initexRegistersCommand,
106 \ initexTablesCommand
107
108 syn match initexBoxCommand display contains=@NoSpell
109 \ '\\\%([hv]\=box\|[cx]\=leaders\|copy\|[hv]rule\|lastbox\|setbox\|un[hv]\%(box\|copy\)\|vtop\)\>'
110 syn match initexCharacterCommand display contains=@NoSpell
111 \ '\\\%([] ]\|\%(^^M\|accent\|char\|\%(lower\|upper\)case\|number\|romannumeral\|string\)\>\)'
112 syn match initexDebuggingCommand display contains=@NoSpell
113 \ '\\\%(\%(batch\|\%(non\|error\)stop\|scroll\)mode\|\%(err\)\=message\|meaning\|show\%(box\%(breadth\|depth\)\=\|lists\|the\)\)\>'
114 syn match initexFileIOCommand display contains=@NoSpell
115 \ '\\\%(\%(close\|open\)\%(in\|out\)\|endinput\|immediate\|input\|read\|shipout\|special\|write\)\>'
116 syn match initexFontsCommand display contains=@NoSpell
117 \ '\\\%(/\|fontname\)\>'
118 syn match initexGlueCommand display contains=@NoSpell
119 \ '\\\%([hv]\|un\)skip\>'
120 syn match initexHyphenationCommand display contains=@NoSpell
121 \ '\\\%(discretionary\|hyphenation\|patterns\|setlanguage\)\>'
122 syn match initexInsertsCommand display contains=@NoSpell
123 \ '\\\%(insert\|split\%(bot\|first\)mark\|vsplit\)\>'
124 syn match initexJobCommand display contains=@NoSpell
125 \ '\\\%(dump\|end\|jobname\)\>'
126 syn match initexKernCommand display contains=@NoSpell
127 \ '\\\%(kern\|lower\|move\%(left\|right\)\|raise\|unkern\)\>'
128 syn match initexLogicCommand display contains=@NoSpell
129 \ '\\\%(else\|fi\|if[a-zA-Z@]\+\|or\)\>'
130 " \ '\\\%(else\|fi\|if\%(case\|cat\|dim\|eof\|false\|[hv]box\|[hmv]mode\|inner\|num\|odd\|true\|void\|x\)\=\|or\)\>'
131 syn match initexMacroCommand display contains=@NoSpell
132 \ '\\\%(after\%(assignment\|group\)\|\%(begin\|end\)group\|\%(end\)\=csname\|e\=def\|expandafter\|futurelet\|global\|let\|long\|noexpand\|outer\|relax\|the\)\>'
133 syn match initexMarksCommand display contains=@NoSpell
134 \ '\\\%(bot\|first\|top\)\=mark\>'
135 syn match initexMathCommand display contains=@NoSpell
136 \ '\\\%(abovewithdelims\|delimiter\|display\%(limits\|style\)\|l\=eqno\|left\|\%(no\)\=limits\|math\%(accent\|bin\|char\|choice\|close\|code\|inner\|op\|open\|ord\|punct\|rel\)\|mkern\|mskip\|muskipdef\|nonscript\|\%(over\|under\)line\|radical\|right\|\%(\%(script\)\{1,2}\|text\)style\|vcenter\)\>'
137 syn match initexParagraphCommand display contains=@NoSpell
138 \ '\\\%(ignorespaces\|indent\|no\%(boundary\|indent\)\|par\|vadjust\)\>'
139 syn match initexPenaltiesCommand display contains=@NoSpell
140 \ '\\\%(un\)\=penalty\>'
141 syn match initexRegistersCommand display contains=@NoSpell
142 \ '\\\%(advance\|\%(count\|dimen\|skip\|toks\)def\|divide\|multiply\)\>'
143 syn match initexTablesCommand display contains=@NoSpell
144 \ '\\\%(cr\|crcr\|[hv]align\|noalign\|omit\|span\)\>'
145
146 syn cluster initexDerivedCommand
147 \ contains=initexGlueDerivedCommand,initexHyphenationDerivedCommand,
148 \ initexMacroDerivedCommand,initexMathDerivedCommand
149
150 syn match initexGlueDerivedCommand display contains=@NoSpell
151 \ '\\\%([hv]fil\%(l\|neg\)\=\|[hv]ss\)\>'
152 syn match initexHyphenationDerivedCommand display contains=@NoSpell
153 \ '\\-'
154 syn match initexMacroDerivedCommand display contains=@NoSpell
155 \ '\\[gx]def\>'
156 syn match initexMathDerivedCommand display contains=@NoSpell
157 \ '\\\%(above\|atop\%(withdelims\)\=\|mathchardef\|over\|overwithdelims\)\>'
158
159 syn cluster initexInternalQuantity
160 \ contains=initexBoxInternalQuantity,initexCharacterInternalQuantity,
161 \ initexFileIOInternalQuantity,initexFontsInternalQuantity,
162 \ initexHyphenationInternalQuantity,initexJobInternalQuantity,
163 \ initexKernInternalQuantity,initexMathInternalQuantity,
164 \ initexPageInternalQuantity,initexParagraphInternalQuantity,
165 \ initexPenaltiesInternalQuantity,initexRegistersInternalQuantity
166
167 syn match initexBoxInternalQuantity display contains=@NoSpell
168 \ '\\\%(badness\|dp\|ht\|prevdepth\|wd\)\>'
169 syn match initexCharacterInternalQuantity display contains=@NoSpell
170 \ '\\\%(catcode\|chardef\|\%([ul]c\|sf\)code\)\>'
171 syn match initexFileIOInternalQuantity display contains=@NoSpell
172 \ '\\inputlineno\>'
173 syn match initexFontsInternalQuantity display contains=@NoSpell
174 \ '\\\%(font\%(dimen\)\=\|nullfont\)\>'
175 syn match initexHyphenationInternalQuantity display contains=@NoSpell
176 \ '\\hyphenchar\>'
177 syn match initexJobInternalQuantity display contains=@NoSpell
178 \ '\\deadcycles\>'
179 syn match initexKernInternalQuantity display contains=@NoSpell
180 \ '\\lastkern\>'
181 syn match initexMathInternalQuantity display contains=@NoSpell
182 \ '\\\%(delcode\|mathcode\|muskip\|\%(\%(script\)\{1,2}\|text\)font\|skewchar\)\>'
183 syn match initexPageInternalQuantity display contains=@NoSpell
184 \ '\\page\%(depth\|fil\{1,3}stretch\|goal\|shrink\|stretch\|total\)\>'
185 syn match initexParagraphInternalQuantity display contains=@NoSpell
186 \ '\\\%(prevgraf\|spacefactor\)\>'
187 syn match initexPenaltiesInternalQuantity display contains=@NoSpell
188 \ '\\lastpenalty\>'
189 syn match initexRegistersInternalQuantity display contains=@NoSpell
190 \ '\\\%(count\|dimen\|skip\|toks\)\d\+\>'
191
192 syn cluster initexParameterDimen
193 \ contains=initexBoxParameterDimen,initexInsertsParameterDimen,
194 \ initexMathParameterDimen,initexPageParameterDimen,
195 \ initexParagraphParameterDimen
196
197 syn match initexBoxParameterDimen display contains=@NoSpell
198 \ '\\\%(boxmaxdepth\|[hv]fuzz\|overfullrule\)\>'
199 syn match initexInsertsParameterDimen display contains=@NoSpell
200 \ '\\splitmaxdepth\>'
201 syn match initexMathParameterDimen display contains=@NoSpell
202 \ '\\\%(delimitershortfall\|display\%(indent\|width\)\|mathsurround\|nulldelimiterspace\|predisplaysize\|scriptspace\)\>'
203 syn match initexPageParameterDimen display contains=@NoSpell
204 \ '\\\%([hv]offset\|maxdepth\|vsize\)\>'
205 syn match initexParagraphParameterDimen display contains=@NoSpell
206 \ '\\\%(emergencystretch\|\%(hang\|par\)indent\|hsize\|lineskiplimit\)\>'
207
208 syn cluster initexParameterGlue
209 \ contains=initexInsertsParameterGlue,initexMathParameterGlue,
210 \ initexPageParameterGlue,initexParagraphParameterGlue,
211 \ initexTablesParameterGlue
212
213 syn match initexInsertsParameterGlue display contains=@NoSpell
214 \ '\\splittopskip\>'
215 syn match initexMathParameterGlue display contains=@NoSpell
216 \ '\\\%(above\|below\)display\%(short\)\=skip\>'
217 syn match initexPageParameterGlue display contains=@NoSpell
218 \ '\\topskip\>'
219 syn match initexParagraphParameterGlue display contains=@NoSpell
220 \ '\\\%(baseline\|left\|line\|par\%(fill\)\=\|right\|x\=space\)skip\>'
221 syn match initexTablesParameterGlue display contains=@NoSpell
222 \ '\\tabskip\>'
223
224 syn cluster initexParameterInteger
225 \ contains=initexBoxParameterInteger,initexCharacterParameterInteger,
226 \ initexDebuggingParameterInteger,initexHyphenationParameterInteger,
227 \ initexInsertsParameterInteger,initexJobParameterInteger,
228 \ initexMacroParameterInteger,initexMathParameterInteger,
229 \ initexParagraphParameterInteger,initexPenaltiesParameterInteger,
230
231 syn match initexBoxParameterInteger display contains=@NoSpell
232 \ '\\[hv]badness\>'
233 syn match initexCharacterParameterInteger display contains=@NoSpell
234 \ '\\\%(\%(endline\|escape\|newline\)char\)\>'
235 syn match initexDebuggingParameterInteger display contains=@NoSpell
236 \ '\\\%(errorcontextlines\|pausing\|tracing\%(commands\|lostchars\|macros\|online\|output\|pages\|paragraphs\|restores|stats\)\)\>'
237 syn match initexHyphenationParameterInteger display contains=@NoSpell
238 \ '\\\%(defaulthyphenchar\|language\|\%(left\|right\)hyphenmin\|uchyph\)\>'
239 syn match initexInsertsParameterInteger display contains=@NoSpell
240 \ '\\\%(holdinginserts\)\>'
241 syn match initexJobParameterInteger display contains=@NoSpell
242 \ '\\\%(day\|mag\|maxdeadcycles\|month\|time\|year\)\>'
243 syn match initexMacroParameterInteger display contains=@NoSpell
244 \ '\\globaldefs\>'
245 syn match initexMathParameterInteger display contains=@NoSpell
246 \ '\\\%(binoppenalty\|defaultskewchar\|delimiterfactor\|displaywidowpenalty\|fam\|\%(post\|pre\)displaypenalty\|relpenalty\)\>'
247 syn match initexParagraphParameterInteger display contains=@NoSpell
248 \ '\\\%(\%(adj\|\%(double\|final\)hyphen\)demerits\|looseness\|\%(pre\)\=tolerance\)\>'
249 syn match initexPenaltiesParameterInteger display contains=@NoSpell
250 \ '\\\%(broken\|club\|exhyphen\|floating\|hyphen\|interline\|line\|output\|widow\)penalty\>'
251
252 syn cluster initexParameterMuglue
253 \ contains=initexMathParameterMuglue
254
255 syn match initexMathParameterMuglue display contains=@NoSpell
256 \ '\\\%(med\|thick\|thin\)muskip\>'
257
258 syn cluster initexParameterDimen
259 \ contains=initexBoxParameterToken,initexDebuggingParameterToken,
260 \ initexFileIOParameterToken,initexMathParameterToken,
261 \ initexParagraphParameterToken,initexTablesParameterToken
262
263 syn match initexBoxParameterToken display contains=@NoSpell
264 \ '\\every[hv]box\>'
265 syn match initexDebuggingParameterToken display contains=@NoSpell
266 \ '\\errhelp\>'
267 syn match initexFileIOParameterToken display contains=@NoSpell
268 \ '\\output\>'
269 syn match initexMathParameterToken display contains=@NoSpell
270 \ '\\every\%(display\|math\)\>'
271 syn match initexParagraphParameterToken display contains=@NoSpell
272 \ '\\everypar\>'
273 syn match initexTablesParameterToken display contains=@NoSpell
274 \ '\\everycr\>'
275
276
277 hi def link initexCharacter Character
278 hi def link initexNumber Number
279
280 hi def link initexIdentifier Identifier
281
282 hi def link initexStatement Statement
283 hi def link initexConditional Conditional
284
285 hi def link initexPreProc PreProc
286 hi def link initexMacro Macro
287
288 hi def link initexType Type
289
290 hi def link initexDebug Debug
291
292 hi def link initexTodo Todo
293 hi def link initexComment Comment
294 hi def link initexDimension initexNumber
295
296 hi def link initexCommand initexStatement
297 hi def link initexBoxCommand initexCommand
298 hi def link initexCharacterCommand initexCharacter
299 hi def link initexDebuggingCommand initexDebug
300 hi def link initexFileIOCommand initexCommand
301 hi def link initexFontsCommand initexType
302 hi def link initexGlueCommand initexCommand
303 hi def link initexHyphenationCommand initexCommand
304 hi def link initexInsertsCommand initexCommand
305 hi def link initexJobCommand initexPreProc
306 hi def link initexKernCommand initexCommand
307 hi def link initexLogicCommand initexConditional
308 hi def link initexMacroCommand initexMacro
309 hi def link initexMarksCommand initexCommand
310 hi def link initexMathCommand initexCommand
311 hi def link initexParagraphCommand initexCommand
312 hi def link initexPenaltiesCommand initexCommand
313 hi def link initexRegistersCommand initexCommand
314 hi def link initexTablesCommand initexCommand
315
316 hi def link initexDerivedCommand initexStatement
317 hi def link initexGlueDerivedCommand initexDerivedCommand
318 hi def link initexHyphenationDerivedCommand initexDerivedCommand
319 hi def link initexMacroDerivedCommand initexDerivedCommand
320 hi def link initexMathDerivedCommand initexDerivedCommand
321
322 hi def link initexInternalQuantity initexIdentifier
323 hi def link initexBoxInternalQuantity initexInternalQuantity
324 hi def link initexCharacterInternalQuantity initexInternalQuantity
325 hi def link initexFileIOInternalQuantity initexInternalQuantity
326 hi def link initexFontsInternalQuantity initexInternalQuantity
327 hi def link initexHyphenationInternalQuantity initexInternalQuantity
328 hi def link initexJobInternalQuantity initexInternalQuantity
329 hi def link initexKernInternalQuantity initexInternalQuantity
330 hi def link initexMathInternalQuantity initexInternalQuantity
331 hi def link initexPageInternalQuantity initexInternalQuantity
332 hi def link initexParagraphInternalQuantity initexInternalQuantity
333 hi def link initexPenaltiesInternalQuantity initexInternalQuantity
334 hi def link initexRegistersInternalQuantity initexInternalQuantity
335
336 hi def link initexParameterDimen initexNumber
337 hi def link initexBoxParameterDimen initexParameterDimen
338 hi def link initexInsertsParameterDimen initexParameterDimen
339 hi def link initexMathParameterDimen initexParameterDimen
340 hi def link initexPageParameterDimen initexParameterDimen
341 hi def link initexParagraphParameterDimen initexParameterDimen
342
343 hi def link initexParameterGlue initexNumber
344 hi def link initexInsertsParameterGlue initexParameterGlue
345 hi def link initexMathParameterGlue initexParameterGlue
346 hi def link initexPageParameterGlue initexParameterGlue
347 hi def link initexParagraphParameterGlue initexParameterGlue
348 hi def link initexTablesParameterGlue initexParameterGlue
349
350 hi def link initexParameterInteger initexNumber
351 hi def link initexBoxParameterInteger initexParameterInteger
352 hi def link initexCharacterParameterInteger initexParameterInteger
353 hi def link initexDebuggingParameterInteger initexParameterInteger
354 hi def link initexHyphenationParameterInteger initexParameterInteger
355 hi def link initexInsertsParameterInteger initexParameterInteger
356 hi def link initexJobParameterInteger initexParameterInteger
357 hi def link initexMacroParameterInteger initexParameterInteger
358 hi def link initexMathParameterInteger initexParameterInteger
359 hi def link initexParagraphParameterInteger initexParameterInteger
360 hi def link initexPenaltiesParameterInteger initexParameterInteger
361
362 hi def link initexParameterMuglue initexNumber
363 hi def link initexMathParameterMuglue initexParameterMuglue
364
365 hi def link initexParameterToken initexIdentifier
366 hi def link initexBoxParameterToken initexParameterToken
367 hi def link initexDebuggingParameterToken initexParameterToken
368 hi def link initexFileIOParameterToken initexParameterToken
369 hi def link initexMathParameterToken initexParameterToken
370 hi def link initexParagraphParameterToken initexParameterToken
371 hi def link initexTablesParameterToken initexParameterToken
372
373 let b:current_syntax = "initex"
374
375 let &cpo = s:cpo_save
376 unlet s:cpo_save