1
0
forked from aniani/vim

Make updating text for conceal mode simpler. A few compiler warning fixes.

This commit is contained in:
Bram Moolenaar
2010-07-02 20:20:09 +02:00
parent 730cde924c
commit b2c0350c67
17 changed files with 324 additions and 267 deletions

View File

@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM>
" Last Change: Apr 14, 2010
" Version: 47
" Last Change: Jun 24, 2010
" Version: 48
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
"
" Notes: {{{1
@@ -125,6 +125,10 @@ if !exists("tex_no_math")
syn cluster texSubSectionGroup contains=texSubSubSectionZone,texParaZone
syn cluster texSubSubSectionGroup contains=texParaZone
syn cluster texParaGroup contains=texSubParaZone
if has("conceal") && &enc == 'utf-8'
syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript
syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript
endif
endif
" Try to flag {} and () mismatches: {{{1
@@ -337,11 +341,11 @@ if !exists("tex_no_math")
call TexNewMathZone("L","xxalignat",0)
" Inline Math Zones: {{{2
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup
syn match texMathOper "[_^=]" contained
@@ -465,6 +469,118 @@ if !exists("g:tex_no_error")
syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained
endif
" support for
if has("conceal") && &enc == 'utf-8'
syn match texGreek '\\alpha\>' contained conceal cchar=α
syn match texGreek '\\beta\>' contained conceal cchar=β
syn match texGreek '\\gamma\>' contained conceal cchar=γ
syn match texGreek '\\delta\>' contained conceal cchar=δ
syn match texGreek '\\epsilon\>' contained conceal cchar=ϵ
syn match texGreek '\\varepsilon\>' contained conceal cchar=ε
syn match texGreek '\\zeta\>' contained conceal cchar=ζ
syn match texGreek '\\eta\>' contained conceal cchar=η
syn match texGreek '\\theta\>' contained conceal cchar=θ
syn match texGreek '\\vartheta\>' contained conceal cchar=ϑ
syn match texGreek '\\kappa\>' contained conceal cchar=κ
syn match texGreek '\\lambda\>' contained conceal cchar=λ
syn match texGreek '\\mu\>' contained conceal cchar=μ
syn match texGreek '\\nu\>' contained conceal cchar=ν
syn match texGreek '\\xi\>' contained conceal cchar=ξ
syn match texGreek '\\pi\>' contained conceal cchar=π
syn match texGreek '\\varpi\>' contained conceal cchar=ϖ
syn match texGreek '\\rho\>' contained conceal cchar=ρ
syn match texGreek '\\varrho\>' contained conceal cchar=ϱ
syn match texGreek '\\sigma\>' contained conceal cchar=σ
syn match texGreek '\\varsigma\>' contained conceal cchar=ς
syn match texGreek '\\tau\>' contained conceal cchar=τ
syn match texGreek '\\upsilon\>' contained conceal cchar=υ
syn match texGreek '\\phi\>' contained conceal cchar=φ
syn match texGreek '\\varphi\>' contained conceal cchar=ϕ
syn match texGreek '\\chi\>' contained conceal cchar=χ
syn match texGreek '\\psi\>' contained conceal cchar=ψ
syn match texGreek '\\omega\>' contained conceal cchar=ω
syn match texGreek '\\Gamma\>' contained conceal cchar=Γ
syn match texGreek '\\Delta\>' contained conceal cchar=Δ
syn match texGreek '\\Theta\>' contained conceal cchar=Θ
syn match texGreek '\\Lambda\>' contained conceal cchar=Λ
syn match texGreek '\\Xi\>' contained conceal cchar=Χ
syn match texGreek '\\Pi\>' contained conceal cchar=Π
syn match texGreek '\\Sigma\>' contained conceal cchar=Σ
syn match texGreek '\\Upsilon\>' contained conceal cchar=Υ
syn match texGreek '\\Phi\>' contained conceal cchar=Φ
syn match texGreek '\\Psi\>' contained conceal cchar=Ψ
syn match texGreek '\\Omega\>' contained conceal cchar=Ω
syn match texSuperscript '\^0' contained conceal cchar=
syn match texSuperscript '\^1' contained conceal cchar=¹
syn match texSuperscript '\^2' contained conceal cchar=²
syn match texSuperscript '\^3' contained conceal cchar=³
syn match texSuperscript '\^4' contained conceal cchar=
syn match texSuperscript '\^5' contained conceal cchar=
syn match texSuperscript '\^6' contained conceal cchar=
syn match texSuperscript '\^7' contained conceal cchar=
syn match texSuperscript '\^8' contained conceal cchar=
syn match texSuperscript '\^9' contained conceal cchar=
syn match texSuperscript '\^a' contained conceal cchar=
syn match texSuperscript '\^b' contained conceal cchar=
syn match texSuperscript '\^c' contained conceal cchar=
syn match texSuperscript '\^d' contained conceal cchar=
syn match texSuperscript '\^e' contained conceal cchar=
syn match texSuperscript '\^f' contained conceal cchar=
syn match texSuperscript '\^g' contained conceal cchar=
syn match texSuperscript '\^h' contained conceal cchar=ʰ
syn match texSuperscript '\^i' contained conceal cchar=
syn match texSuperscript '\^j' contained conceal cchar=ʲ
syn match texSuperscript '\^k' contained conceal cchar=
syn match texSuperscript '\^l' contained conceal cchar=ˡ
syn match texSuperscript '\^m' contained conceal cchar=
syn match texSuperscript '\^n' contained conceal cchar=
syn match texSuperscript '\^o' contained conceal cchar=
syn match texSuperscript '\^p' contained conceal cchar=
syn match texSuperscript '\^r' contained conceal cchar=ʳ
syn match texSuperscript '\^s' contained conceal cchar=ˢ
syn match texSuperscript '\^t' contained conceal cchar=
syn match texSuperscript '\^u' contained conceal cchar=
syn match texSuperscript '\^v' contained conceal cchar=
syn match texSuperscript '\^w' contained conceal cchar=ʷ
syn match texSuperscript '\^x' contained conceal cchar=ˣ
syn match texSuperscript '\^y' contained conceal cchar=ʸ
syn match texSuperscript '\^z' contained conceal cchar=
syn match texSuperscript '\^A' contained conceal cchar=
syn match texSuperscript '\^B' contained conceal cchar=
syn match texSuperscript '\^D' contained conceal cchar=
syn match texSuperscript '\^E' contained conceal cchar=
syn match texSuperscript '\^G' contained conceal cchar=
syn match texSuperscript '\^H' contained conceal cchar=
syn match texSuperscript '\^I' contained conceal cchar=
syn match texSuperscript '\^J' contained conceal cchar=
syn match texSuperscript '\^K' contained conceal cchar=
syn match texSuperscript '\^L' contained conceal cchar=
syn match texSuperscript '\^M' contained conceal cchar=
syn match texSuperscript '\^N' contained conceal cchar=
syn match texSuperscript '\^O' contained conceal cchar=
syn match texSuperscript '\^P' contained conceal cchar=
syn match texSuperscript '\^R' contained conceal cchar=ᴿ
syn match texSuperscript '\^T' contained conceal cchar=
syn match texSuperscript '\^U' contained conceal cchar=
syn match texSuperscript '\^W' contained conceal cchar=
syn match texSubscript '_0' contained conceal cchar=
syn match texSubscript '_1' contained conceal cchar=
syn match texSubscript '_2' contained conceal cchar=
syn match texSubscript '_3' contained conceal cchar=
syn match texSubscript '_4' contained conceal cchar=
syn match texSubscript '_5' contained conceal cchar=
syn match texSubscript '_6' contained conceal cchar=
syn match texSubscript '_7' contained conceal cchar=
syn match texSubscript '_8' contained conceal cchar=
syn match texSubscript '_9' contained conceal cchar=
syn match texSubscript '_a' contained conceal cchar=
syn match texSubscript '_e' contained conceal cchar=
syn match texSubscript '_i' contained conceal cchar=
syn match texSubscript '_o' contained conceal cchar=
syn match texSubscript '_u' contained conceal cchar=
endif
" ---------------------------------------------------------------------
" LaTeX synchronization: {{{1
syn sync maxlines=200
syn sync minlines=50
@@ -487,6 +603,7 @@ if !exists("tex_no_math")
syn sync match texSyncMathZoneA groupthere NONE "\\\(sub\)*section\>"
endif
" ---------------------------------------------------------------------
" Highlighting: {{{1
if did_tex_syntax_inits == 1
let did_tex_syntax_inits= 2