Mercurial > vim
comparison runtime/syntax/tex.vim @ 190:a1f18bd133d6
updated for version 7.0057
author | vimboss |
---|---|
date | Mon, 07 Mar 2005 23:20:08 +0000 |
parents | 125e80798a85 |
children | f8b75b8f1988 |
comparison
equal
deleted
inserted
replaced
189:504c627f7474 | 190:a1f18bd133d6 |
---|---|
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: Oct 13, 2004 | 4 " Last Change: Mar 02, 2005 |
5 " Version: 26 | 5 " Version: 27 |
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, |
51 endif | 51 endif |
52 if exists("g:tex_tex") && !exists("g:tex_no_error") | 52 if exists("g:tex_tex") && !exists("g:tex_no_error") |
53 let g:tex_no_error= 1 | 53 let g:tex_no_error= 1 |
54 endif | 54 endif |
55 | 55 |
56 " Determine whether or not to use "*.sty" mode | 56 " Determine whether or not to use "*.sty" mode {{{1 |
57 " The user may override the normal determination by setting | 57 " The user may override the normal determination by setting |
58 " g:tex_stylish to 1 (for "*.sty" mode) | 58 " g:tex_stylish to 1 (for "*.sty" mode) |
59 " or to 0 else (normal "*.tex" mode) | 59 " or to 0 else (normal "*.tex" mode) |
60 " or on a buffer-by-buffer basis with b:tex_stylish | 60 " or on a buffer-by-buffer basis with b:tex_stylish |
61 let b:extfname=expand("%:e") | 61 let b:extfname=expand("%:e") |
67 else | 67 else |
68 let b:tex_stylish= 0 | 68 let b:tex_stylish= 0 |
69 endif | 69 endif |
70 endif | 70 endif |
71 | 71 |
72 " handle folding {{{1 | |
73 if !exists("g:tex_fold_enabled") | |
74 let g:tex_fold_enabled= 0 | |
75 elseif g:tex_fold_enabled && !has("folding") | |
76 let g:sh_fold_enabled= 0; | |
77 echomsg "Ignoring g:tex_fold_enabled=".g:tex_fold_enabled."; need to re-compile vim for +fold support" | |
78 endif | |
79 if g:tex_fold_enabled && &fdm == "manual" | |
80 set fdm=syntax | |
81 endif | |
82 | |
83 | |
72 " (La)TeX keywords: only use the letters a-zA-Z {{{1 | 84 " (La)TeX keywords: only use the letters a-zA-Z {{{1 |
73 " but _ is the only one that causes problems. | 85 " but _ is the only one that causes problems. |
74 if version < 600 | 86 if version < 600 |
75 set isk-=_ | 87 set isk-=_ |
76 if b:tex_stylish | 88 if b:tex_stylish |
231 " \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x | 243 " \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 | 244 syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar |
233 syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained | 245 syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained |
234 | 246 |
235 " Sections, subsections, etc: {{{1 | 247 " Sections, subsections, etc: {{{1 |
236 if exists("tex_dosynfolds") && has("folding") | 248 if g:tex_fold_enabled && has("folding") |
237 " COMBAK -- this folding doesn't work as expected as yet | 249 syn region texSectionZone matchgroup=texSection start="\\\(sub\)*\(section\|author\|part\|chapter\|paragraph\)\*\=\>" end="\ze\\\(sub\)*\(section\|author\|part\|chapter\|paragraph\)\*\=\>" end="%\s*stopzone\>" contains=TOP fold |
238 syn region Red matchgroup=texSection start="\\section\*\=\>" end="\\\%(sub\)*\%(abstract\|section\|author\|part\|chapter\|paragraph\|subparagraph\)\*\=\>"me=s end="%\s*stopzone\>" fold | 250 syn region texSectionZone matchgroup=texSection start="\\begin\s*{\s*abstract\s*}" end="\\end\s*{\s*abstract\s*}" contains=TOP 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 | 251 else |
250 syn match texSection "\\\(sub\)*section\*\=\>" | 252 syn match texSection "\\\(sub\)*section\*\=\>" |
251 syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>" | 253 syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>" |
252 syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}" | 254 syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}" |
253 endif | 255 endif |