Mercurial > vim
comparison runtime/syntax/tex.vim @ 9737:35ce559b8553
commit https://github.com/vim/vim/commit/bc8801c9317eb721a2ee91322669f2dd5d136380
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 2 21:04:33 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 02 Aug 2016 21:15:06 +0200 |
parents | 619a98a67f67 |
children | 43efa4f5a8ea |
comparison
equal
deleted
inserted
replaced
9736:d963b7420aa2 | 9737:35ce559b8553 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: TeX | 2 " Language: TeX |
3 " Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM> | 3 " Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM> |
4 " Last Change: Jun 17, 2016 | 4 " Last Change: Jul 05, 2016 |
5 " Version: 97 | 5 " Version: 98 |
6 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX | 6 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX |
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, |
130 " (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 | 130 " (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 |
131 " but _ is the only one that causes problems. | 131 " but _ is the only one that causes problems. |
132 " One may override this iskeyword setting by providing | 132 " One may override this iskeyword setting by providing |
133 " g:tex_isk | 133 " g:tex_isk |
134 if exists("g:tex_isk") | 134 if exists("g:tex_isk") |
135 exe "setlocal isk=".g:tex_isk | 135 if b:tex_stylish && g:tex_isk !~ '@' |
136 elseif !has("patch-7.4.1142") | 136 let b:tex_isk= '@,'.g:tex_isk |
137 setl isk=48-57,a-z,A-Z,192-255 | 137 else |
138 else | 138 let b:tex_isk= g:tex_isk |
139 syn iskeyword 48-57,a-z,A-Z,192-255 | 139 endif |
140 endif | 140 elseif b:tex_stylish |
141 if b:tex_stylish | 141 let b:tex_isk="@,48-57,a-z,A-Z,192-255" |
142 setlocal isk+=@-@ | 142 else |
143 let b:tex_isk="48-57,a-z,A-Z,192-255" | |
144 endif | |
145 if v:version > 704 || (v:version == 704 && has("patch-7.4.1142")) | |
146 exe "syn iskeyword ".b:tex_isk | |
147 else | |
148 exe "setl isk=".b:tex_isk | |
143 endif | 149 endif |
144 if exists("g:tex_no_error") && g:tex_no_error | 150 if exists("g:tex_no_error") && g:tex_no_error |
145 let s:tex_no_error= 1 | 151 let s:tex_no_error= 1 |
146 else | 152 else |
147 let s:tex_no_error= 0 | 153 let s:tex_no_error= 0 |
157 let s:tex_nospell = 0 | 163 let s:tex_nospell = 0 |
158 endif | 164 endif |
159 | 165 |
160 " Clusters: {{{1 | 166 " Clusters: {{{1 |
161 " -------- | 167 " -------- |
162 syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle | 168 syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,@texMathZones |
163 if !s:tex_no_error | 169 if !s:tex_no_error |
164 syn cluster texCmdGroup add=texMathError | 170 syn cluster texCmdGroup add=texMathError |
165 endif | 171 endif |
166 syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement | 172 syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement |
167 syn cluster texFoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texItalStyle,texNoSpell | 173 syn cluster texFoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texItalStyle,texNoSpell |
445 call TexNewMathZone("E","equation",1) | 451 call TexNewMathZone("E","equation",1) |
446 call TexNewMathZone("F","flalign",1) | 452 call TexNewMathZone("F","flalign",1) |
447 call TexNewMathZone("G","gather",1) | 453 call TexNewMathZone("G","gather",1) |
448 call TexNewMathZone("H","math",1) | 454 call TexNewMathZone("H","math",1) |
449 call TexNewMathZone("I","multline",1) | 455 call TexNewMathZone("I","multline",1) |
450 call TexNewMathZone("J","subequations",0) | 456 call TexNewMathZone("J","xalignat",1) |
451 call TexNewMathZone("K","xalignat",1) | 457 call TexNewMathZone("K","xxalignat",0) |
452 call TexNewMathZone("L","xxalignat",0) | |
453 | 458 |
454 " Inline Math Zones: {{{2 | 459 " Inline Math Zones: {{{2 |
455 if s:tex_fast =~# 'M' | 460 if s:tex_fast =~# 'M' |
456 if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'd' | 461 if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'd' |
457 syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup | 462 syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup |
479 endif | 484 endif |
480 | 485 |
481 " \left..something.. and \right..something.. support: {{{2 | 486 " \left..something.. and \right..something.. support: {{{2 |
482 syn match texMathDelimBad contained "\S" | 487 syn match texMathDelimBad contained "\S" |
483 if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'm' | 488 if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'm' |
484 syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ | 489 syn match texMathDelim contained "\\left\[" |
485 syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} | 490 syn match texMathDelim contained "\\left\\{" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ |
491 syn match texMathDelim contained "\\right\\}" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} | |
486 let s:texMathDelimList=[ | 492 let s:texMathDelimList=[ |
487 \ ['<' , '<'] , | 493 \ ['<' , '<'] , |
488 \ ['>' , '>'] , | 494 \ ['>' , '>'] , |
489 \ ['(' , '('] , | 495 \ ['(' , '('] , |
490 \ [')' , ')'] , | 496 \ [')' , ')'] , |