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