comparison runtime/syntax/tex.vim @ 36:125e80798a85 v7.0021

updated for version 7.0021
author vimboss
date Thu, 09 Dec 2004 21:34:53 +0000
parents bdeee1504ac1
children a1f18bd133d6
comparison
equal deleted inserted replaced
35:8f3a526c2fe1 36:125e80798a85
1 " Vim syntax file 1 " Vim syntax file
2 " Language: TeX 2 " Language: TeX
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> 3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
4 " Last Change: Jun 15, 2004 4 " Last Change: Oct 13, 2004
5 " Version: 25 5 " Version: 26
6 " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax 6 " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
7 " 7 "
8 " Notes: {{{1 8 " Notes: {{{1
9 " 9 "
10 " 1. If you have a \begin{verbatim} that appears to overrun its boundaries, 10 " 1. If you have a \begin{verbatim} that appears to overrun its boundaries,
110 syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError 110 syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError
111 else 111 else
112 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup 112 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup
113 syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup 113 syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup
114 endif 114 endif
115 syn region texParen start="(" end=")" contains=@texMatchGroup 115 syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell
116 if !exists("g:tex_no_error") 116 if !exists("g:tex_no_error")
117 syn match texError "[}\])]" 117 syn match texError "[}\])]"
118 endif 118 endif
119 if !exists("tex_no_math") 119 if !exists("tex_no_math")
120 if !exists("g:tex_no_error") 120 if !exists("g:tex_no_error")
231 " \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x 231 " \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x
232 syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar 232 syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar
233 syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained 233 syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
234 234
235 " Sections, subsections, etc: {{{1 235 " Sections, subsections, etc: {{{1
236 syn match texSection "\\\(sub\)*section\*\=\>" 236 if exists("tex_dosynfolds") && has("folding")
237 syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>" 237 " COMBAK -- this folding doesn't work as expected as yet
238 syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}" 238 syn region Red matchgroup=texSection start="\\section\*\=\>" end="\\\%(sub\)*\%(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>"me=s end="%\s*stopzone\>" fold
239 " syn region Red matchgroup=texSection start="\\section\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" end="%\s*stopzone\>" contains=TOP fold
240 " syn region Blue matchgroup=texSection start="\\subsection\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
241 " syn region texSectionZone matchgroup=texSection start="\\subsubsection\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
242 " syn region texSectionZone matchgroup=texSection start="\\title\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
243 " syn region texSectionZone matchgroup=texSection start="\\author\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
244 " syn region texSectionZone matchgroup=texSection start="\\part\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
245 " syn region texSectionZone matchgroup=texSection start="\\chapter\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
246 " syn region texSectionZone matchgroup=texSection start="\\paragraph\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
247 " syn region texSectionZone matchgroup=texSection start="\\subparagraph\*\=\>" end="\ze\\\(sub\)*\(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>" contains=TOP fold
248 " syn region texSectionZone matchgroup=texSection start="\\begin\s*{\s*abstract\s*}" end="\\end\s*{\s*abstract\s*}" contains=TOP fold
249 else
250 syn match texSection "\\\(sub\)*section\*\=\>"
251 syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>"
252 syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}"
253 endif
239 254
240 " Bad Math (mismatched): {{{1 255 " Bad Math (mismatched): {{{1
241 if !exists("tex_no_math") 256 if !exists("tex_no_math")
242 syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}" 257 syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
243 syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}" 258 syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"