1" Vim syntax file
2" Language:	Texinfo (macro package for TeX)
3" Maintainer:	Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
4" URL:		<->
5" Last Change:	2004 Jun 23
6"
7" the file follows the Texinfo manual structure; this file is based
8" on manual for Texinfo version 4.0, 28 September 1999
9" since @ can have special meanings, everything is 'match'-ed and 'region'-ed
10" (including @ in 'iskeyword' option has unexpected effects)
11
12" Remove any old syntax stuff hanging around, if needed
13if version < 600
14  syn clear
15elseif exists("b:current_syntax")
16  finish
17endif
18
19if !exists("main_syntax")
20  let main_syntax = 'texinfo'
21endif
22
23"in Texinfo can be real big things, like tables; sync for that
24syn sync lines=200
25
26"some general stuff
27"syn match texinfoError     "\S" contained TODO
28syn match texinfoIdent	    "\k\+"		  contained "IDENTifier
29syn match texinfoAssignment "\k\+\s*=\s*\k\+\s*$" contained "assigment statement ( var = val )
30syn match texinfoSinglePar  "\k\+\s*$"		  contained "single parameter (used for several @-commands)
31syn match texinfoIndexPar   "\k\k\s*$"		  contained "param. used for different *index commands (+ @documentlanguage command)
32
33
34"marking words and phrases (chap. 9 in Texinfo manual)
35"(almost) everything appears as 'contained' too; is for tables (@table)
36
37"this chapter is at the beginning of this file to avoid overwritings
38
39syn match texinfoSpecialChar				    "@acronym"		contained
40syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@acronym{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
41syn match texinfoSpecialChar				    "@b"		contained
42syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@b{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
43syn match texinfoSpecialChar				    "@cite"		contained
44syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@cite{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
45syn match texinfoSpecialChar				    "@code"		contained
46syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@code{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
47syn match texinfoSpecialChar				    "@command"		contained
48syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@command{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
49syn match texinfoSpecialChar				    "@dfn"		contained
50syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dfn{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
51syn match texinfoSpecialChar				    "@email"		contained
52syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@email{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
53syn match texinfoSpecialChar				    "@emph"		contained
54syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@emph{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
55syn match texinfoSpecialChar				    "@env"		contained
56syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@env{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
57syn match texinfoSpecialChar				    "@file"		contained
58syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@file{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
59syn match texinfoSpecialChar				    "@i"		contained
60syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@i{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
61syn match texinfoSpecialChar				    "@kbd"		contained
62syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@kbd{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
63syn match texinfoSpecialChar				    "@key"		contained
64syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@key{"	end="}" contains=texinfoSpecialChar
65syn match texinfoSpecialChar				    "@option"		contained
66syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@option{"	end="}" contains=texinfoSpecialChar
67syn match texinfoSpecialChar				    "@r"		contained
68syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@r{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
69syn match texinfoSpecialChar				    "@samp"		contained
70syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@samp{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
71syn match texinfoSpecialChar				    "@sc"		contained
72syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@sc{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
73syn match texinfoSpecialChar				    "@strong"		contained
74syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@strong{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
75syn match texinfoSpecialChar				    "@t"		contained
76syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@t{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
77syn match texinfoSpecialChar				    "@url"		contained
78syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@url{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
79syn match texinfoSpecialChar				    "@var"		contained
80syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@var{"	end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
81syn match texinfoAtCmd "^@kbdinputstyle" nextgroup=texinfoSinglePar skipwhite
82
83
84"overview of Texinfo (chap. 1 in Texinfo manual)
85syn match texinfoComment  "@c .*"
86syn match texinfoComment  "@c$"
87syn match texinfoComment  "@comment .*"
88syn region texinfoMltlnAtCmd matchgroup=texinfoComment start="^@ignore\s*$" end="^@end ignore\s*$" contains=ALL
89
90
91"beginning a Texinfo file (chap. 3 in Texinfo manual)
92syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="@center "		 skip="\\$" end="$"		       contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
93syn region texinfoMltlnDMAtCmd matchgroup=texinfoAtCmd start="^@detailmenu\s*$"		    end="^@end detailmenu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
94syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="^@setfilename "    skip="\\$" end="$" contains=texinfoSpecialChar oneline
95syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="^@settitle "       skip="\\$" end="$" contains=texinfoSpecialChar oneline
96syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="^@shorttitlepage " skip="\\$" end="$" contains=texinfoSpecialChar oneline
97syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="^@title "		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
98syn region texinfoBrcPrmAtCmd  matchgroup=texinfoAtCmd start="@titlefont{"		    end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
99syn region texinfoMltlnAtCmd   matchgroup=texinfoAtCmd start="^@titlepage\s*$"		    end="^@end titlepage\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd,texinfoAtCmd,texinfoPrmAtCmd,texinfoMltlnAtCmd
100syn region texinfoPrmAtCmd     matchgroup=texinfoAtCmd start="^@vskip "		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
101syn match texinfoAtCmd "^@exampleindent"     nextgroup=texinfoSinglePar skipwhite
102syn match texinfoAtCmd "^@headings"	     nextgroup=texinfoSinglePar skipwhite
103syn match texinfoAtCmd "^\\input"	     nextgroup=texinfoSinglePar skipwhite
104syn match texinfoAtCmd "^@paragraphindent"   nextgroup=texinfoSinglePar skipwhite
105syn match texinfoAtCmd "^@setchapternewpage" nextgroup=texinfoSinglePar skipwhite
106
107
108"ending a Texinfo file (chap. 4 in Texinfo manual)
109syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="@author " skip="\\$" end="$" contains=texinfoSpecialChar oneline
110"all below @bye should be comment TODO
111syn match texinfoAtCmd "^@bye\s*$"
112syn match texinfoAtCmd "^@contents\s*$"
113syn match texinfoAtCmd "^@printindex" nextgroup=texinfoIndexPar skipwhite
114syn match texinfoAtCmd "^@setcontentsaftertitlepage\s*$"
115syn match texinfoAtCmd "^@setshortcontentsaftertitlepage\s*$"
116syn match texinfoAtCmd "^@shortcontents\s*$"
117syn match texinfoAtCmd "^@summarycontents\s*$"
118
119
120"chapter structuring (chap. 5 in Texinfo manual)
121syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendix"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
122syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsec"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
123syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsection"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
124syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsec"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
125syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsubsec"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
126syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@centerchap"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
127syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapheading"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
128syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapter"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
129syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@heading"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
130syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@majorheading"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
131syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@section"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
132syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subheading "	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
133syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsection"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
134syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubheading"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
135syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubsection"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
136syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subtitle"		 skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
137syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumbered"		 skip="\\$" end="$" contains=texinfoSpecialChar oneline
138syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsec"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
139syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsec"	 skip="\\$" end="$" contains=texinfoSpecialChar oneline
140syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
141syn match  texinfoAtCmd "^@lowersections\s*$"
142syn match  texinfoAtCmd "^@raisesections\s*$"
143
144
145"nodes (chap. 6 in Texinfo manual)
146syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@anchor{"		  end="}"
147syn region texinfoPrmAtCmd    matchgroup=texinfoAtCmd start="^@top"    skip="\\$" end="$" contains=texinfoSpecialChar oneline
148syn region texinfoPrmAtCmd    matchgroup=texinfoAtCmd start="^@node"   skip="\\$" end="$" contains=texinfoSpecialChar oneline
149
150
151"menus (chap. 7 in Texinfo manual)
152syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@menu\s*$" end="^@end menu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd
153
154
155"cross references (chap. 8 in Texinfo manual)
156syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@inforef{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
157syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@pxref{"   end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
158syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@ref{"     end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
159syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@uref{"    end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
160syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@xref{"    end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
161
162
163"marking words and phrases (chap. 9 in Texinfo manual)
164"(almost) everything appears as 'contained' too; is for tables (@table)
165
166"this chapter is at the beginning of this file to avoid overwritings
167
168
169"quotations and examples (chap. 10 in Texinfo manual)
170syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@cartouche\s*$"	    end="^@end cartouche\s*$"	    contains=ALL
171syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@display\s*$"	    end="^@end display\s*$"	    contains=ALL
172syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@example\s*$"	    end="^@end example\s*$"	    contains=ALL
173syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushleft\s*$"	    end="^@end flushleft\s*$"	    contains=ALL
174syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushright\s*$"	    end="^@end flushright\s*$"	    contains=ALL
175syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@format\s*$"	    end="^@end format\s*$"	    contains=ALL
176syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@lisp\s*$"		    end="^@end lisp\s*$"	    contains=ALL
177syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@quotation\s*$"	    end="^@end quotation\s*$"	    contains=ALL
178syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalldisplay\s*$"     end="^@end smalldisplay\s*$"    contains=ALL
179syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallexample\s*$"     end="^@end smallexample\s*$"    contains=ALL
180syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallformat\s*$"	    end="^@end smallformat\s*$"     contains=ALL
181syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalllisp\s*$"	    end="^@end smalllisp\s*$"	    contains=ALL
182syn region texinfoPrmAtCmd   matchgroup=texinfoAtCmd start="^@exdent"	 skip="\\$" end="$"			    contains=texinfoSpecialChar oneline
183syn match texinfoAtCmd "^@noindent\s*$"
184syn match texinfoAtCmd "^@smallbook\s*$"
185
186
187"lists and tables (chap. 11 in Texinfo manual)
188syn match texinfoAtCmd "@asis"		   contained
189syn match texinfoAtCmd "@columnfractions"  contained
190syn match texinfoAtCmd "@item"		   contained
191syn match texinfoAtCmd "@itemx"		   contained
192syn match texinfoAtCmd "@tab"		   contained
193syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@enumerate"  end="^@end enumerate\s*$"  contains=ALL
194syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ftable"     end="^@end ftable\s*$"     contains=ALL
195syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@itemize"    end="^@end itemize\s*$"    contains=ALL
196syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@multitable" end="^@end multitable\s*$" contains=ALL
197syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@table"      end="^@end table\s*$"      contains=ALL
198syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@vtable"     end="^@end vtable\s*$"     contains=ALL
199
200
201"indices (chap. 12 in Texinfo manual)
202syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@\(c\|f\|k\|p\|t\|v\)index"   skip="\\$" end="$" contains=texinfoSpecialChar oneline
203syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@..index"			 skip="\\$" end="$" contains=texinfoSpecialChar oneline
204"@defcodeindex and @defindex is defined after chap. 15's @def* commands (otherwise those ones will overwrite these ones)
205syn match texinfoSIPar "\k\k\s*\k\k\s*$" contained
206syn match texinfoAtCmd "^@syncodeindex" nextgroup=texinfoSIPar skipwhite
207syn match texinfoAtCmd "^@synindex"     nextgroup=texinfoSIPar skipwhite
208
209"special insertions (chap. 13 in Texinfo manual)
210syn match texinfoSpecialChar "@\(!\|?\|@\|\s\)"
211syn match texinfoSpecialChar "@{"
212syn match texinfoSpecialChar "@}"
213"accents
214syn match texinfoSpecialChar "@=."
215syn match texinfoSpecialChar "@\('\|\"\|\^\|`\)[aeiouyAEIOUY]"
216syn match texinfoSpecialChar "@\~[aeinouyAEINOUY]"
217syn match texinfoSpecialChar "@dotaccent{.}"
218syn match texinfoSpecialChar "@H{.}"
219syn match texinfoSpecialChar "@,{[cC]}"
220syn match texinfoSpecialChar "@AA{}"
221syn match texinfoSpecialChar "@aa{}"
222syn match texinfoSpecialChar "@L{}"
223syn match texinfoSpecialChar "@l{}"
224syn match texinfoSpecialChar "@O{}"
225syn match texinfoSpecialChar "@o{}"
226syn match texinfoSpecialChar "@ringaccent{.}"
227syn match texinfoSpecialChar "@tieaccent{..}"
228syn match texinfoSpecialChar "@u{.}"
229syn match texinfoSpecialChar "@ubaraccent{.}"
230syn match texinfoSpecialChar "@udotaccent{.}"
231syn match texinfoSpecialChar "@v{.}"
232"ligatures
233syn match texinfoSpecialChar "@AE{}"
234syn match texinfoSpecialChar "@ae{}"
235syn match texinfoSpecialChar "@copyright{}"
236syn match texinfoSpecialChar "@bullet" contained "for tables and lists
237syn match texinfoSpecialChar "@bullet{}"
238syn match texinfoSpecialChar "@dotless{i}"
239syn match texinfoSpecialChar "@dotless{j}"
240syn match texinfoSpecialChar "@dots{}"
241syn match texinfoSpecialChar "@enddots{}"
242syn match texinfoSpecialChar "@equiv" contained "for tables and lists
243syn match texinfoSpecialChar "@equiv{}"
244syn match texinfoSpecialChar "@error{}"
245syn match texinfoSpecialChar "@exclamdown{}"
246syn match texinfoSpecialChar "@expansion{}"
247syn match texinfoSpecialChar "@minus" contained "for tables and lists
248syn match texinfoSpecialChar "@minus{}"
249syn match texinfoSpecialChar "@OE{}"
250syn match texinfoSpecialChar "@oe{}"
251syn match texinfoSpecialChar "@point" contained "for tables and lists
252syn match texinfoSpecialChar "@point{}"
253syn match texinfoSpecialChar "@pounds{}"
254syn match texinfoSpecialChar "@print{}"
255syn match texinfoSpecialChar "@questiondown{}"
256syn match texinfoSpecialChar "@result" contained "for tables and lists
257syn match texinfoSpecialChar "@result{}"
258syn match texinfoSpecialChar "@ss{}"
259syn match texinfoSpecialChar "@TeX{}"
260"other
261syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dmn{"      end="}"
262syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@footnote{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
263syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@image{"    end="}"
264syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@math{"     end="}"
265syn match texinfoAtCmd "@footnotestyle" nextgroup=texinfoSinglePar skipwhite
266
267
268"making and preventing breaks (chap. 14 in Texinfo manual)
269syn match texinfoSpecialChar  "@\(\*\|-\|\.\)"
270syn match texinfoAtCmd	      "^@need"	   nextgroup=texinfoSinglePar skipwhite
271syn match texinfoAtCmd	      "^@page\s*$"
272syn match texinfoAtCmd	      "^@sp"	   nextgroup=texinfoSinglePar skipwhite
273syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@group\s*$"   end="^@end group\s*$" contains=ALL
274syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@hyphenation{" end="}"
275syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@w{"	    end="}"		  contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
276
277
278"definition commands (chap. 15 in Texinfo manual)
279syn match texinfoMltlnAtCmdFLine "^@def\k\+" contained
280syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@def\k\+" end="^@end def\k\+$"      contains=ALL
281
282"next 2 commands are from chap. 12; must be defined after @def* commands above to overwrite them
283syn match texinfoAtCmd "@defcodeindex" nextgroup=texinfoIndexPar skipwhite
284syn match texinfoAtCmd "@defindex" nextgroup=texinfoIndexPar skipwhite
285
286
287"conditionally visible text (chap. 16 in Texinfo manual)
288syn match texinfoAtCmd "^@clear" nextgroup=texinfoSinglePar skipwhite
289syn region texinfoMltln2AtCmd matchgroup=texinfoAtCmd start="^@html\s*$"	end="^@end html\s*$"
290syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifclear"		end="^@end ifclear\s*$"   contains=ALL
291syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifhtml"		end="^@end ifhtml\s*$"	  contains=ALL
292syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifinfo"		end="^@end ifinfo\s*$"	  contains=ALL
293syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifnothtml"	end="^@end ifnothtml\s*$" contains=ALL
294syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifnotinfo"	end="^@end ifnotinfo\s*$" contains=ALL
295syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifnottex"	end="^@end ifnottex\s*$"  contains=ALL
296syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@ifset"		end="^@end ifset\s*$"	  contains=ALL
297syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@iftex"		end="^@end iftex\s*$"	  contains=ALL
298syn region texinfoPrmAtCmd    matchgroup=texinfoAtCmd start="^@set " skip="\\$" end="$" contains=texinfoSpecialChar oneline
299syn region texinfoTexCmd			      start="\$\$"		end="\$\$" contained
300syn region texinfoMltlnAtCmd  matchgroup=texinfoAtCmd start="^@tex"		end="^@end tex\s*$"	  contains=texinfoTexCmd
301syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@value{"		end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
302
303
304"internationalization (chap. 17 in Texinfo manual)
305syn match texinfoAtCmd "@documentencoding" nextgroup=texinfoSinglePar skipwhite
306syn match texinfoAtCmd "@documentlanguage" nextgroup=texinfoIndexPar skipwhite
307
308
309"defining new texinfo commands (chap. 18 in Texinfo manual)
310syn match texinfoAtCmd	"@alias"		      nextgroup=texinfoAssignment skipwhite
311syn match texinfoDIEPar "\S*\s*,\s*\S*\s*,\s*\S*\s*$" contained
312syn match texinfoAtCmd	"@definfoenclose"	      nextgroup=texinfoDIEPar	  skipwhite
313syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@macro" end="^@end macro\s*$" contains=ALL
314
315
316"formatting hardcopy (chap. 19 in Texinfo manual)
317syn match texinfoAtCmd "^@afourlatex\s*$"
318syn match texinfoAtCmd "^@afourpaper\s*$"
319syn match texinfoAtCmd "^@afourwide\s*$"
320syn match texinfoAtCmd "^@finalout\s*$"
321syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@pagesizes" end="$" oneline
322
323
324"creating and installing Info Files (chap. 20 in Texinfo manual)
325syn region texinfoPrmAtCmd   matchgroup=texinfoAtCmd start="^@dircategory"  skip="\\$" end="$" oneline
326syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@direntry\s*$"	       end="^@end direntry\s*$" contains=texinfoSpecialChar
327syn match  texinfoAtCmd "^@novalidate\s*$"
328
329
330"include files (appendix E in Texinfo manual)
331syn match texinfoAtCmd "^@include" nextgroup=texinfoSinglePar skipwhite
332
333
334"page headings (appendix F in Texinfo manual)
335syn match texinfoHFSpecialChar "@|"		  contained
336syn match texinfoThisAtCmd     "@thischapter"	  contained
337syn match texinfoThisAtCmd     "@thischaptername" contained
338syn match texinfoThisAtCmd     "@thisfile"	  contained
339syn match texinfoThisAtCmd     "@thispage"	  contained
340syn match texinfoThisAtCmd     "@thistitle"	  contained
341syn match texinfoThisAtCmd     "@today{}"	  contained
342syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenfooting"  skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
343syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenheading"  skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
344syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
345syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
346syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddfooting"   skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
347syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddheading"   skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
348
349
350"refilling paragraphs (appendix H in Texinfo manual)
351syn match  texinfoAtCmd "@refill"
352
353
354syn cluster texinfoAll contains=ALLBUT,texinfoThisAtCmd,texinfoHFSpecialChar
355syn cluster texinfoReducedAll contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
356"==============================================================================
357" highlighting
358
359" For version 5.7 and earlier: only when not done already
360" For version 5.8 and later: only when an item doesn't have highlighting yet
361if version >= 508 || !exists("did_texinfo_syn_inits")
362
363  if version < 508
364    let did_texinfo_syn_inits = 1
365    command -nargs=+ HiLink hi link <args>
366  else
367    command -nargs=+ HiLink hi def link <args>
368  endif
369
370  HiLink texinfoSpecialChar	Special
371  HiLink texinfoHFSpecialChar	Special
372
373  HiLink texinfoError		Error
374  HiLink texinfoIdent		Identifier
375  HiLink texinfoAssignment	Identifier
376  HiLink texinfoSinglePar	Identifier
377  HiLink texinfoIndexPar	Identifier
378  HiLink texinfoSIPar		Identifier
379  HiLink texinfoDIEPar		Identifier
380  HiLink texinfoTexCmd		PreProc
381
382
383  HiLink texinfoAtCmd		Statement	"@-command
384  HiLink texinfoPrmAtCmd	String		"@-command in one line with unknown nr. of parameters
385						"is String because is found as a region and is 'matchgroup'-ed
386						"to texinfoAtCmd
387  HiLink texinfoBrcPrmAtCmd	String		"@-command with parameter(s) in braces ({})
388						"is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
389  HiLink texinfoMltlnAtCmdFLine  texinfoAtCmd	"repeated embedded First lines in @-commands
390  HiLink texinfoMltlnAtCmd	String		"@-command in multiple lines
391						"is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
392  HiLink texinfoMltln2AtCmd	PreProc		"@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
393  HiLink texinfoMltlnDMAtCmd	PreProc		"@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors; used for @detailmenu, which can be included in @menu)
394  HiLink texinfoMltlnNAtCmd	Normal		"@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
395  HiLink texinfoThisAtCmd	Statement	"@-command used in headers and footers (@this... series)
396
397  HiLink texinfoComment	Comment
398
399  delcommand HiLink
400endif
401
402
403let b:current_syntax = "texinfo"
404
405if main_syntax == 'texinfo'
406  unlet main_syntax
407endif
408
409" vim: ts=8
410