816
|
1 " Vim syntax file
|
|
2 " Language: TeX (plain.tex format)
|
|
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
|
837
|
4 " Latest Revision: 2006-04-19
|
816
|
5
|
|
6 if exists("b:current_syntax")
|
|
7 finish
|
|
8 endif
|
|
9
|
|
10 let s:cpo_save = &cpo
|
|
11 set cpo&vim
|
|
12
|
|
13 syn match plaintexControlSequence display contains=@NoSpell
|
|
14 \ '\\[a-zA-Z@]\+'
|
|
15
|
837
|
16 runtime! syntax/initex.vim
|
816
|
17
|
|
18 syn match plaintexComment display
|
837
|
19 \ contains=ALLBUT,initexComment,plaintexComment
|
816
|
20 \ '^\s*%[CDM].*$'
|
|
21
|
|
22 if exists("g:plaintex_delimiters")
|
|
23 syn match plaintexDelimiter display '[][{}]'
|
|
24 endif
|
|
25
|
|
26 syn match plaintexRepeat display contains=@NoSpell
|
|
27 \ '\\\%(loop\|repeat\)\>'
|
|
28
|
|
29 syn match plaintexCommand display contains=@NoSpell
|
|
30 \ '\\\%(plainoutput\|TeX\)\>'
|
|
31 syn match plaintexBoxCommand display contains=@NoSpell
|
|
32 \ '\\\%(null\|strut\)\>'
|
|
33 syn match plaintexCharacterCommand display contains=@NoSpell
|
|
34 \ /\\\%(["#$%&'.=^_`~]\|``\|''\|-\{2,3}\|[?!]`\|^^L\|\~\|\%(a[ae]\|A[AE]\|acute\|[cdHoOPStuvijlL]\|copyright\|d\=dag\|folio\|ldotp\|[lr]q\|oe\|OE\|slash\|ss\|underbar\)\>\)/
|
|
35 syn match plaintexDebuggingCommand display contains=@NoSpell
|
|
36 \ '\\\%(showhyphens\|tracingall\|wlog\)\>'
|
|
37 syn match plaintexFontsCommand display contains=@NoSpell
|
|
38 \ '\\\%(bf\|\%(five\|seven\)\%(bf\|i\|rm\|sy\)\|it\|oldstyle\|rm\|sl\|ten\%(bf\|ex\|it\=\|rm\|sl\|sy\|tt\)\|tt\)\>'
|
|
39 syn match plaintexGlueCommand display contains=@NoSpell
|
|
40 \ '\\\%(\%(big\|en\|med\|\%(no\|off\)interline\|small\)skip\|\%(center\|left\|right\)\=line\|\%(dot\|\%(left\|right\)arrow\)fill\|[hv]glue\|[lr]lap\|q\=quad\|space\|topglue\)\>'
|
|
41 syn match plaintexInsertsCommand display contains=@NoSpell
|
|
42 \ '\\\%(\%(end\|top\)insert\|v\=footnote\)\>'
|
|
43 syn match plaintexJobCommand display contains=@NoSpell
|
|
44 \ '\\\%(bye\|fmt\%(name\|version\)\)\>'
|
|
45 syn match plaintexInsertsCommand display contains=@NoSpell
|
|
46 \ '\\\%(mid\|page\)insert\>'
|
|
47 syn match plaintexKernCommand display contains=@NoSpell
|
|
48 \ '\\\%(en\|\%(neg\)\=thin\)space\>'
|
|
49 syn match plaintexMacroCommand display contains=@NoSpell
|
|
50 \ '\\\%(active\|[be]group\|empty\)\>'
|
|
51 syn match plaintexPageCommand display contains=@NoSpell
|
|
52 \ '\\\%(\%(super\)\=eject\|nopagenumbers\|\%(normal\|ragged\)bottom\)\>'
|
|
53 syn match plaintexParagraphCommand display contains=@NoSpell
|
|
54 \ '\\\%(endgraf\|\%(non\)\=frenchspacing\|hang\|item\%(item\)\=\|narrower\|normalbaselines\|obey\%(lines\|spaces\)\|openup\|proclaim\|\%(tt\)\=raggedright\|textindent\)\>'
|
|
55 syn match plaintexPenaltiesCommand display contains=@NoSpell
|
|
56 \ '\\\%(allow\|big\|fil\|good\|med\|no\|small\)\=break\>'
|
|
57 syn match plaintexRegistersCommand display contains=@NoSpell
|
|
58 \ '\\\%(advancepageno\|new\%(box\|count\|dimen\|fam\|help\|if\|insert\|language\|muskip\|read\|skip\|toks\|write\)\)\>'
|
|
59 syn match plaintexTablesCommand display contains=@NoSpell
|
|
60 \ '&\|\\+\|\\\%(cleartabs\|endline\|hidewidth\|ialign\|multispan\|settabs\|tabalign\)\>'
|
|
61
|
837
|
62 if !exists("g:plaintex_no_math")
|
|
63 syn region plaintexMath matchgroup=plaintexMath
|
816
|
64 \ contains=@plaintexMath
|
|
65 \ start='\$' skip='\\\\\|\\\$' end='\$'
|
837
|
66 syn region plaintexMath matchgroup=plaintexMath
|
816
|
67 \ contains=@plaintexMath keepend
|
|
68 \ start='\$\$' skip='\\\\\|\\\$' end='\$\$'
|
837
|
69 endif
|
816
|
70
|
|
71 syn cluster plaintexMath
|
|
72 \ contains=plaintexMathCommand,plaintexMathBoxCommand,
|
|
73 \ plaintexMathCharacterCommand,plaintexMathDelimiter,
|
|
74 \ plaintexMathFontsCommand,plaintexMathLetter,plaintexMathSymbol,
|
|
75 \ plaintexMathFunction,plaintexMathOperator,plaintexMathPunctuation,
|
|
76 \ plaintexMathRelation
|
|
77
|
|
78 syn match plaintexMathCommand display contains=@NoSpell contained
|
|
79 \ '\\\%([!*,;>{}|_^]\|\%([aA]rrowvert\|[bB]ig\%(g[lmr]\=\|r\)\=\|\%(border\|p\)\=matrix\|displaylines\|\%(down\|up\)bracefill\|eqalign\%(no\)\|leqalignno\|[lr]moustache\|mathpalette\|root\|s[bp]\|skew\|sqrt\)\>\)'
|
|
80 syn match plaintexMathBoxCommand display contains=@NoSpell contained
|
|
81 \ '\\\%([hv]\=phantom\|mathstrut\|smash\)\>'
|
|
82 syn match plaintexMathCharacterCommand display contains=@NoSpell contained
|
|
83 \ '\\\%(b\|bar\|breve\|check\|d\=dots\=\|grave\|hat\|[lv]dots\|tilde\|vec\|wide\%(hat\|tilde\)\)\>'
|
|
84 syn match plaintexMathDelimiter display contains=@NoSpell contained
|
|
85 \ '\\\%(brace\%(vert\)\=\|brack\|cases\|choose\|[lr]\%(angle\|brace\|brack\|ceil\|floor\|group\)\|over\%(brace\|\%(left\|right\)arrow\)\|underbrace\)\>'
|
|
86 syn match plaintexMathFontsCommand display contains=@NoSpell contained
|
|
87 \ '\\\%(\%(bf\|it\|sl\|tt\)fam\|cal\|mit\)\>'
|
|
88 syn match plaintexMathLetter display contains=@NoSpell contained
|
|
89 \ '\\\%(aleph\|alpha\|beta\|chi\|[dD]elta\|ell\|epsilon\|eta\|[gG]amma\|[ij]math\|iota\|kappa\|[lL]ambda\|[mn]u\|[oO]mega\|[pP][hs]\=i\|rho\|[sS]igma\|tau\|[tT]heta\|[uU]psilon\|var\%(epsilon\|ph\=i\|rho\|sigma\|theta\)\|[xX]i\|zeta\)\>'
|
|
90 syn match plaintexMathSymbol display contains=@NoSpell contained
|
|
91 \ '\\\%(angle\|backslash\|bot\|clubsuit\|emptyset\|epsilon\|exists\|flat\|forall\|hbar\|heartsuit\|Im\|infty\|int\|lnot\|nabla\|natural\|neg\|pmod\|prime\|Re\|sharp\|smallint\|spadesuit\|surd\|top\|triangle\%(left\|right\)\=\|vdash\|wp\)\>'
|
|
92 syn match plaintexMathFunction display contains=@NoSpell contained
|
|
93 \ '\\\%(arc\%(cos\|sin\|tan\)\|arg\|\%(cos\|sin\|tan\)h\=\|coth\=\|csc\|de[gt]\|dim\|exp\|gcd\|hom\|inf\|ker\|lo\=g\|lim\%(inf\|sup\)\=\|ln\|max\|min\|Pr\|sec\|sup\)\>'
|
|
94 syn match plaintexMathOperator display contains=@NoSpell contained
|
|
95 \ '\\\%(amalg\|ast\|big\%(c[au]p\|circ\|o\%(dot\|plus\|times\|sqcup\)\|triangle\%(down\|up\)\|uplus\|vee\|wedge\|bmod\|bullet\)\|c[au]p\|cdot[ps]\=\|circ\|coprod\|d\=dagger\|diamond\%(suit\)\=\|div\|land\|lor\|mp\|o\%(dot\|int\|minus\|plus\|slash\|times\)pm\|prod\|setminus\|sqc[au]p\|sqsu[bp]seteq\|star\|su[bp]set\%(eq\)\=\|sum\|times\|uplus\|vee\|wedge\|wr\)\>'
|
|
96 syn match plaintexMathPunctuation display contains=@NoSpell contained
|
|
97 \ '\\\%(colon\)\>'
|
|
98 syn match plaintexMathRelation display contains=@NoSpell contained
|
|
99 \ '\\\%(approx\|asymp\|bowtie\|buildrel\|cong\|dashv\|doteq\|[dD]ownarrow\|equiv\|frown\|geq\=\|gets\|gg\|hook\%(left\|right\)arrow\|iff\|in\|leq\=\|[lL]eftarrow\|\%(left\|right\)harpoon\%(down\|up\)\|[lL]eftrightarrow\|ll\|[lL]ongleftrightarrow\|longmapsto\|[lL]ongrightarrow\|mapsto\|mid\|models\|[ns][ew]arrow\|neq\=\|ni\|not\%(in\)\=\|owns\|parallel\|perp\|prec\%(eq\)\=\|propto\|[rR]ightarrow\|rightleftharpoons\|sim\%(eq\)\=\|smile\|succ\%(eq\)\=\|to\|[uU]parrow\|[uU]pdownarrow\|[vV]ert\)\>'
|
|
100
|
|
101 syn match plaintexParameterDimen display contains=@NoSpell
|
|
102 \ '\\maxdimen\>'
|
|
103 syn match plaintexMathParameterDimen display contains=@NoSpell
|
|
104 \ '\\jot\>'
|
|
105 syn match plaintexParagraphParameterGlue display contains=@NoSpell
|
|
106 \ '\\\%(\%(big\|med\|small\)skipamount\|normalbaselineskip\|normallineskip\%(limit\)\=\)\>'
|
|
107
|
|
108 syn match plaintexFontParameterInteger display contains=@NoSpell
|
|
109 \ '\\magstep\%(half\)\=\>'
|
|
110 syn match plaintexJobParameterInteger display contains=@NoSpell
|
|
111 \ '\\magnification\>'
|
|
112 syn match plaintexPageParameterInteger display contains=@NoSpell
|
|
113 \ '\\pageno\>'
|
|
114
|
|
115 syn match plaintexPageParameterToken display contains=@NoSpell
|
|
116 \ '\\\%(foot\|head\)line\>'
|
|
117
|
|
118 hi def link plaintexOperator Operator
|
|
119
|
|
120 hi def link plaintexDelimiter Delimiter
|
|
121
|
|
122 hi def link plaintexControlSequence Identifier
|
|
123 hi def link plaintexComment Comment
|
|
124 hi def link plaintexInclude Include
|
|
125 hi def link plaintexRepeat Repeat
|
|
126
|
837
|
127 hi def link plaintexCommand initexCommand
|
816
|
128 hi def link plaintexBoxCommand plaintexCommand
|
837
|
129 hi def link plaintexCharacterCommand initexCharacterCommand
|
|
130 hi def link plaintexDebuggingCommand initexDebuggingCommand
|
|
131 hi def link plaintexFontsCommand initexFontsCommand
|
816
|
132 hi def link plaintexGlueCommand plaintexCommand
|
|
133 hi def link plaintexInsertsCommand plaintexCommand
|
837
|
134 hi def link plaintexJobCommand initexJobCommand
|
816
|
135 hi def link plaintexKernCommand plaintexCommand
|
837
|
136 hi def link plaintexMacroCommand initexMacroCommand
|
816
|
137 hi def link plaintexPageCommand plaintexCommand
|
|
138 hi def link plaintexParagraphCommand plaintexCommand
|
|
139 hi def link plaintexPenaltiesCommand plaintexCommand
|
|
140 hi def link plaintexRegistersCommand plaintexCommand
|
|
141 hi def link plaintexTablesCommand plaintexCommand
|
|
142
|
|
143 hi def link plaintexMath String
|
|
144 hi def link plaintexMathCommand plaintexCommand
|
|
145 hi def link plaintexMathBoxCommand plaintexBoxCommand
|
|
146 hi def link plaintexMathCharacterCommand plaintexCharacterCommand
|
|
147 hi def link plaintexMathDelimiter plaintexDelimiter
|
|
148 hi def link plaintexMathFontsCommand plaintexFontsCommand
|
|
149 hi def link plaintexMathLetter plaintexMathCharacterCommand
|
|
150 hi def link plaintexMathSymbol plaintexMathLetter
|
|
151 hi def link plaintexMathFunction Function
|
|
152 hi def link plaintexMathOperator plaintexOperator
|
|
153 hi def link plaintexMathPunctuation plaintexCharacterCommand
|
|
154 hi def link plaintexMathRelation plaintexOperator
|
|
155
|
837
|
156 hi def link plaintexParameterDimen initexParameterDimen
|
|
157 hi def link plaintexMathParameterDimen initexMathParameterDimen
|
|
158 hi def link plaintexParagraphParameterGlue initexParagraphParameterGlue
|
|
159 hi def link plaintexFontParameterInteger initexFontParameterInteger
|
|
160 hi def link plaintexJobParameterInteger initexJobParameterInteger
|
|
161 hi def link plaintexPageParameterInteger initexPageParameterInteger
|
|
162 hi def link plaintexPageParameterToken initexParameterToken
|
816
|
163
|
|
164 let b:current_syntax = "plaintex"
|
|
165
|
|
166 let &cpo = s:cpo_save
|
|
167 unlet s:cpo_save
|