summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/tex.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/tex.vim')
-rw-r--r--runtime/syntax/tex.vim191
1 files changed, 139 insertions, 52 deletions
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index 365acf4967..b8756a88fc 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change: Dec 07, 2010
-" Version: 64
+" Last Change: Aug 22, 2011
+" Version: 68
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
"
" Notes: {{{1
@@ -101,6 +101,9 @@ endif
if b:tex_stylish
setlocal isk+=@-@
endif
+if exists("g:tex_nospell") && g:tex_nospell && !exists("g:tex_comment_nospell")
+ let g:tex_comment_nospell= 1
+endif
" Clusters: {{{1
" --------
@@ -110,8 +113,13 @@ if !exists("g:tex_no_error")
endif
syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement
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,texSectionMarker,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract
-syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell
-syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher
+if !exists("g:tex_nospell") || !g:tex_nospell
+ syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell
+ syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher
+else
+ syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption
+ syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher
+endif
syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter
if !exists("tex_no_math")
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
@@ -147,7 +155,11 @@ else
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup
syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup
endif
-syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell
+if !exists("g:tex_nospell") || !g:tex_nospell
+ syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell
+else
+ syn region texParen start="(" end=")" contains=@texMatchGroup
+endif
if !exists("g:tex_no_error")
syn match texError "[}\])]"
endif
@@ -155,7 +167,8 @@ if !exists("tex_no_math")
if !exists("g:tex_no_error")
syn match texMathError "}" contained
endif
- syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
+ syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
+" syn region texMathMatcher matchgroup=Unique start="[^\\]\zs{" skip="\\\\\|\\[{}]" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
endif
" TeX/LaTeX keywords: {{{1
@@ -173,6 +186,7 @@ endif
" TeX/LaTeX delimiters: {{{1
syn match texDelimiter "&"
syn match texDelimiter "\\\\"
+syn match texDelimiter "[{}]"
" Tex/Latex Options: {{{1
syn match texOption "[^\\]\zs#\d\+\|^#\d\+"
@@ -273,33 +287,59 @@ syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=
syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
" Sections, subsections, etc: {{{1
-if g:tex_fold_enabled && has("folding")
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell
+if !exists("g:tex_nospell") || !g:tex_nospell
+ if g:tex_fold_enabled && has("folding")
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
+ syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell
+ syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell
+ syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
+ syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
+ syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell
+ syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell
+ syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell
+ syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell
+ else
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
+ syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
+ syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
+ syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
+ syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
+ syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
+ syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
+ syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell
+ syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell
+ endif
else
- syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
- syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
- syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
- syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
- syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
- syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
- syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
- syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
- syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell
- syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell
+ if g:tex_fold_enabled && has("folding")
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
+ syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup
+ syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup
+ syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
+ syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup
+ syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup
+ syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup
+ syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup
+ syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup
+ else
+ syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
+ syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup
+ syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup
+ syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup
+ syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
+ syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup
+ syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup
+ syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup
+ syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup
+ syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup
+ endif
endif
" Bad Math (mismatched): {{{1
if !exists("tex_no_math")
- syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|smallmatrix\|xxalignat\)\s*}"
+ syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
syn match texBadMath "\\[\])]"
endif
@@ -344,6 +384,7 @@ if !exists("tex_no_math")
call TexNewMathZone("G","gather",1)
call TexNewMathZone("H","math",1)
call TexNewMathZone("I","multline",1)
+ call TexNewMathZone("J","subequations",0)
call TexNewMathZone("K","xalignat",1)
call TexNewMathZone("L","xxalignat",0)
@@ -364,7 +405,11 @@ if !exists("tex_no_math")
syn match texMathOper "[_^=]" contained
" Text Inside Math Zones: {{{2
- syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell
+ if !exists("g:tex_nospell") || !g:tex_nospell
+ syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell
+ else
+ syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup
+ endif
" \left..something.. and \right..something.. support: {{{2
syn match texMathDelimBad contained "\S"
@@ -501,16 +546,15 @@ else
endif
" Tex Reference Zones: {{{1
-syn match texRefZone '\\@samp\>' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\nocite\>' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\bibliography\>' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\label\>' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\\(page\|eq\)ref\>' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\v\=ref' skipwhite nextgroup=texRefLabel
-syn match texRefZone '\\cite\%([tp]\*\=\)\=' skipwhite nextgroup=texCiteOption,texCite
-syn region texRefLabel contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup
-syn region texCiteOption contained matchgroup=Delimiter start='\[' end=']' contains=@Spell,@texRefGroup,@texMathZones,texRefZone nextgroup=texCiteOption,texCite
-syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texCite
+syn region texZone matchgroup=texStatement start="@samp{" end="}\|%stopzone\>" contains=@texRefGroup
+syn region texRefZone matchgroup=texStatement start="\\nocite{" end="}\|%stopzone\>" contains=@texRefGroup
+syn region texRefZone matchgroup=texStatement start="\\bibliography{" end="}\|%stopzone\>" contains=@texRefGroup
+syn region texRefZone matchgroup=texStatement start="\\label{" end="}\|%stopzone\>" contains=@texRefGroup
+syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup
+syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup
+syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite
+syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite
+syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite
" Handle newcommand, newenvironment : {{{1
syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl
@@ -556,12 +600,14 @@ if has("conceal") && &enc == 'utf-8'
if s:tex_conceal =~ 'm'
let s:texMathList=[
\ ['|' , '‖'],
+ \ ['aleph' , 'ℵ'],
\ ['angle' , '∠'],
\ ['approx' , '≈'],
\ ['ast' , '∗'],
\ ['asymp' , '≍'],
\ ['backepsilon' , '∍'],
\ ['backsimeq' , '≃'],
+ \ ['backslash' , '∖'],
\ ['barwedge' , '⊼'],
\ ['because' , '∵'],
\ ['between' , '≬'],
@@ -592,9 +638,11 @@ if has("conceal") && &enc == 'utf-8'
\ ['circlearrowright', '↻'],
\ ['circledast' , '⊛'],
\ ['circledcirc' , '⊚'],
+ \ ['clubsuit' , '♣'],
\ ['complement' , '∁'],
\ ['cong' , '≅'],
\ ['coprod' , '∐'],
+ \ ['copyright' , '©'],
\ ['cup' , '∪'],
\ ['Cup' , '⋓'],
\ ['curlyeqprec' , '⋞'],
@@ -603,6 +651,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['curlywedge' , '⋏'],
\ ['dashv' , '⊣'],
\ ['diamond' , '⋄'],
+ \ ['diamondsuit' , '♢'],
\ ['div' , '÷'],
\ ['doteq' , '≐'],
\ ['doteqdot' , '≑'],
@@ -621,8 +670,10 @@ if has("conceal") && &enc == 'utf-8'
\ ['eqslantgtr' , '⪖'],
\ ['eqslantless' , '⪕'],
\ ['equiv' , '≡'],
+ \ ['ell' , 'ℓ'],
\ ['exists' , '∃'],
\ ['fallingdotseq' , '≒'],
+ \ ['flat' , '♭'],
\ ['forall' , '∀'],
\ ['ge' , '≥'],
\ ['geq' , '≥'],
@@ -633,11 +684,14 @@ if has("conceal") && &enc == 'utf-8'
\ ['gtreqless' , '⋛'],
\ ['gtrless' , '≷'],
\ ['gtrsim' , '≳'],
+ \ ['hbar' , 'ℏ'],
+ \ ['heartsuit' , '♡'],
\ ['hookleftarrow' , '↩'],
\ ['hookrightarrow' , '↪'],
\ ['iiint' , '∭'],
\ ['iint' , '∬'],
\ ['Im' , 'ℑ'],
+ \ ['imath' , 'ɩ'],
\ ['in' , '∈'],
\ ['infty' , '∞'],
\ ['int' , '∫'],
@@ -650,7 +704,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['left(' , '('],
\ ['left\[' , '['],
\ ['left\\{' , '{'],
- \ ['Leftrightarrow' , '⇔'],
+ \ ['leftrightarrow' , '⇔'],
\ ['leftrightsquigarrow', '↭'],
\ ['leftthreetimes' , '⋋'],
\ ['leq' , '≤'],
@@ -667,6 +721,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['mid' , '∣'],
\ ['mp' , '∓'],
\ ['nabla' , '∇'],
+ \ ['natural' , '♮'],
\ ['ncong' , '≇'],
\ ['nearrow' , '↗'],
\ ['ne' , '≠'],
@@ -705,6 +760,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['oslash' , '⊘'],
\ ['otimes' , '⊗'],
\ ['owns' , '∋'],
+ \ ['P' , '¶'],
\ ['partial' , '∂'],
\ ['perp' , '⊥'],
\ ['pitchfork' , '⋔'],
@@ -716,6 +772,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['precnapprox' , '⪹'],
\ ['precneqq' , '⪵'],
\ ['precsim' , '≾'],
+ \ ['prime' , '′'],
\ ['prod' , '∏'],
\ ['propto' , '∝'],
\ ['rceil' , '⌉'],
@@ -732,9 +789,12 @@ if has("conceal") && &enc == 'utf-8'
\ ['risingdotseq' , '≓'],
\ ['rmoustache' , '╮'],
\ ['rtimes' , '⋊'],
+ \ ['S' , '§'],
\ ['searrow' , '↘'],
\ ['setminus' , '∖'],
+ \ ['sharp' , '♯'],
\ ['sim' , '∼'],
+ \ ['spadesuit' , '♠'],
\ ['sphericalangle' , '∢'],
\ ['sqcap' , '⊓'],
\ ['sqcup' , '⊔'],
@@ -767,6 +827,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['times' , '×'],
\ ['to' , '→'],
\ ['top' , '⊤'],
+ \ ['triangle' , '∆'],
\ ['triangleleft' , '⊲'],
\ ['trianglelefteq' , '⊴'],
\ ['triangleq' , '≜'],
@@ -788,6 +849,7 @@ if has("conceal") && &enc == 'utf-8'
\ ['vee' , '∨'],
\ ['Vvdash' , '⊪'],
\ ['wedge' , '∧'],
+ \ ['wp' , '℘'],
\ ['wr' , '≀']]
for texmath in s:texMathList
if texmath[0] =~ '\w$'
@@ -804,6 +866,27 @@ if has("conceal") && &enc == 'utf-8'
syn match texMathSymbol '\\gg\>' contained conceal cchar=⟫
syn match texMathSymbol '\\ll\>' contained conceal cchar=⟪
endif
+
+ syn match texMathSymbol '\\hat{a}' contained conceal cchar=â
+ syn match texMathSymbol '\\hat{A}' contained conceal cchar=Â
+ syn match texMathSymbol '\\hat{c}' contained conceal cchar=ĉ
+ syn match texMathSymbol '\\hat{C}' contained conceal cchar=Ĉ
+ syn match texMathSymbol '\\hat{e}' contained conceal cchar=ê
+ syn match texMathSymbol '\\hat{E}' contained conceal cchar=Ê
+ syn match texMathSymbol '\\hat{g}' contained conceal cchar=ĝ
+ syn match texMathSymbol '\\hat{G}' contained conceal cchar=Ĝ
+ syn match texMathSymbol '\\hat{i}' contained conceal cchar=î
+ syn match texMathSymbol '\\hat{I}' contained conceal cchar=Î
+ syn match texMathSymbol '\\hat{o}' contained conceal cchar=ô
+ syn match texMathSymbol '\\hat{O}' contained conceal cchar=Ô
+ syn match texMathSymbol '\\hat{s}' contained conceal cchar=ŝ
+ syn match texMathSymbol '\\hat{S}' contained conceal cchar=Ŝ
+ syn match texMathSymbol '\\hat{u}' contained conceal cchar=û
+ syn match texMathSymbol '\\hat{U}' contained conceal cchar=Û
+ syn match texMathSymbol '\\hat{w}' contained conceal cchar=ŵ
+ syn match texMathSymbol '\\hat{W}' contained conceal cchar=Ŵ
+ syn match texMathSymbol '\\hat{y}' contained conceal cchar=ŷ
+ syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ŷ
endif
" Greek {{{2
@@ -855,8 +938,8 @@ if has("conceal") && &enc == 'utf-8'
" Superscripts/Subscripts {{{2
if s:tex_conceal =~ 's'
- syn region texSuperscript matchgroup=Delimiter start='\^{' end='}' contained concealends contains=texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
- syn region texSubscript matchgroup=Delimiter start='_{' end='}' contained concealends contains=texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
+ syn region texSuperscript matchgroup=Delimiter start='\^{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
+ syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
fun! s:SuperSub(group,leader,pat,cchar)
exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
@@ -980,18 +1063,23 @@ if has("conceal") && &enc == 'utf-8'
endfor
endfun
" \` \' \^ \" \~ \. \c \H \k \r \u \v
- call s:Accents('a','à','á','â','ä','ã',' ',' ',' ','ą','å','ă','ă')
- call s:Accents('A','À','Á','Â','Ä','Ã',' ',' ',' ','Ą','Å','Ă','Ă')
+ call s:Accents('a','à','á','â','ä','ã','ȧ',' ',' ','ą','å','ă','ă')
+ call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ',' ',' ','Ą','Å','Ă','Ă')
call s:Accents('c',' ','ć','ĉ',' ',' ','ċ','ç',' ',' ',' ',' ','č')
call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ','Ç',' ',' ',' ',' ','Č')
call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
call s:Accents('e','è','é','ê','ë','ẽ','ė','ȩ',' ','ę',' ','ĕ','ě')
call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ȩ',' ','Ę',' ','Ĕ','Ě')
- call s:Accents('g',' ',' ',' ',' ',' ','ġ','ģ',' ',' ',' ','ğ',' ')
- call s:Accents('G',' ',' ',' ',' ',' ','Ġ','Ģ',' ',' ',' ','Ğ',' ')
+ call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ','ģ',' ',' ',' ','ğ',' ')
+ call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ','Ģ',' ',' ',' ','Ğ',' ')
+ call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
+ call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
call s:Accents('i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ','ĭ',' ')
call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ',' ',' ',' ',' ','Ĭ',' ')
+ call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
+ call s:Accents('k',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ',' ')
+ call s:Accents('K',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ',' ')
call s:Accents('l',' ','ĺ','ľ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
call s:Accents('n',' ','ń',' ',' ','ñ',' ','ņ',' ',' ',' ',' ','ň')
@@ -1000,12 +1088,12 @@ if has("conceal") && &enc == 'utf-8'
call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ',' ','Ő','Ǫ',' ','Ŏ',' ')
call s:Accents('r',' ','ŕ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
call s:Accents('R',' ','Ŕ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
- call s:Accents('s',' ','ś','ŝ',' ',' ',' ','ş',' ',' ',' ',' ','š')
+ call s:Accents('s',' ','ś','ŝ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
call s:Accents('t',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
call s:Accents('T',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
- call s:Accents('u','ù','ú','û','ü','ũ',' ',' ','ű',' ','ů','ŭ',' ')
- call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ',' ','Ű',' ','Ů','Ŭ',' ')
+ call s:Accents('u','ù','ú','û','ü','ũ',' ',' ','ű','ų','ů','ŭ','ǔ')
+ call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ',' ','Ű','Ų','Ů','Ŭ','Ǔ')
call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ')
@@ -1068,6 +1156,7 @@ if did_tex_syntax_inits == 1
HiLink texError Error
endif
+ HiLink texCite texRefZone
HiLink texDefCmd texDef
HiLink texDefName texDef
HiLink texDocType texCmdName
@@ -1092,7 +1181,6 @@ if did_tex_syntax_inits == 1
HiLink texMathZoneV texMath
HiLink texMathZoneZ texMath
endif
- HiLink texRefZone Identifier
HiLink texSectionMarker texCmdName
HiLink texSectionName texSection
HiLink texSpaceCode texStatement
@@ -1101,7 +1189,6 @@ if did_tex_syntax_inits == 1
HiLink texTypeStyle texType
" Basic TeX highlighting groups
- HiLink texCite Special
HiLink texCmdArgs Number
HiLink texCmdName Statement
HiLink texComment Comment
@@ -1117,7 +1204,7 @@ if did_tex_syntax_inits == 1
HiLink texNewCmd Statement
HiLink texNewEnv Statement
HiLink texOption Number
- HiLink texRefLabel Special
+ HiLink texRefZone Special
HiLink texSection PreCondit
HiLink texSpaceCodeChar Special
HiLink texSpecialChar SpecialChar