Mercurial > vim
comparison runtime/syntax/tex.vim @ 9344:33c1b85d408c
commit https://github.com/vim/vim/commit/802a0d902fca423acb15f835d7b09183883d79a0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 26 16:17:58 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 26 Jun 2016 16:30:09 +0200 |
parents | 9305a1251e51 |
children | 619a98a67f67 |
comparison
equal
deleted
inserted
replaced
9343:b14783b6c8f6 | 9344:33c1b85d408c |
---|---|
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: May 02, 2016 | 4 " Last Change: Jun 17, 2016 |
5 " Version: 95 | 5 " Version: 97 |
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, |
81 let s:tex_conceal= 'abdmgsS' | 81 let s:tex_conceal= 'abdmgsS' |
82 else | 82 else |
83 let s:tex_conceal= g:tex_conceal | 83 let s:tex_conceal= g:tex_conceal |
84 endif | 84 endif |
85 if !exists("g:tex_superscripts") | 85 if !exists("g:tex_superscripts") |
86 let s:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]" | 86 let s:tex_superscripts= '[0-9a-zA-W.,:;+-<>/()=]' |
87 else | 87 else |
88 let s:tex_superscripts= g:tex_superscripts | 88 let s:tex_superscripts= g:tex_superscripts |
89 endif | 89 endif |
90 if !exists("g:tex_subscripts") | 90 if !exists("g:tex_subscripts") |
91 let s:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]" | 91 let s:tex_subscripts= '[0-9aehijklmnoprstuvx,+-/().]' |
92 else | 92 else |
93 let s:tex_subscripts= g:tex_subscripts | 93 let s:tex_subscripts= g:tex_subscripts |
94 endif | 94 endif |
95 echomsg "s:tex_subscripts=".s:tex_subscripts | |
95 | 96 |
96 " Determine whether or not to use "*.sty" mode {{{1 | 97 " Determine whether or not to use "*.sty" mode {{{1 |
97 " The user may override the normal determination by setting | 98 " The user may override the normal determination by setting |
98 " g:tex_stylish to 1 (for "*.sty" mode) | 99 " g:tex_stylish to 1 (for "*.sty" mode) |
99 " or to 0 else (normal "*.tex" mode) | 100 " or to 0 else (normal "*.tex" mode) |
204 endif | 205 endif |
205 | 206 |
206 " Try to flag {} and () mismatches: {{{1 | 207 " Try to flag {} and () mismatches: {{{1 |
207 if s:tex_fast =~# 'm' | 208 if s:tex_fast =~# 'm' |
208 if !s:tex_no_error | 209 if !s:tex_no_error |
209 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError | 210 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError |
210 syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell | 211 syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell |
211 else | 212 else |
212 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup | 213 syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup |
213 syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup | 214 syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup |
214 endif | 215 endif |
215 if !s:tex_nospell | 216 if !s:tex_nospell |
216 syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell | 217 syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell |
217 else | 218 else |
218 syn region texParen start="(" end=")" transparent contains=@texMatchGroup | 219 syn region texParen start="(" end=")" transparent contains=@texMatchGroup |
219 endif | 220 endif |
220 endif | 221 endif |
221 if !s:tex_no_error | 222 if !s:tex_no_error |
222 syn match texError "[}\])]" | 223 syn match texError "[}\])]" |
223 endif | 224 endif |
264 | 265 |
265 " \begin{}/\end{} section markers: {{{1 | 266 " \begin{}/\end{} section markers: {{{1 |
266 syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName | 267 syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName |
267 if s:tex_fast =~# 'm' | 268 if s:tex_fast =~# 'm' |
268 syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment | 269 syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment |
269 syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell | 270 syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@texMathZones,@NoSpell |
270 endif | 271 endif |
271 | 272 |
272 " \documentclass, \documentstyle, \usepackage: {{{1 | 273 " \documentclass, \documentstyle, \usepackage: {{{1 |
273 syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texBeginEndName,texDocTypeArgs | 274 syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texBeginEndName,texDocTypeArgs |
274 if s:tex_fast =~# 'm' | 275 if s:tex_fast =~# 'm' |
1134 call s:SuperSub('texSubscript','_','7','₇') | 1135 call s:SuperSub('texSubscript','_','7','₇') |
1135 call s:SuperSub('texSubscript','_','8','₈') | 1136 call s:SuperSub('texSubscript','_','8','₈') |
1136 call s:SuperSub('texSubscript','_','9','₉') | 1137 call s:SuperSub('texSubscript','_','9','₉') |
1137 call s:SuperSub('texSubscript','_','a','ₐ') | 1138 call s:SuperSub('texSubscript','_','a','ₐ') |
1138 call s:SuperSub('texSubscript','_','e','ₑ') | 1139 call s:SuperSub('texSubscript','_','e','ₑ') |
1140 call s:SuperSub('texSubscript','_','h','ₕ') | |
1139 call s:SuperSub('texSubscript','_','i','ᵢ') | 1141 call s:SuperSub('texSubscript','_','i','ᵢ') |
1142 call s:SuperSub('texSubscript','_','j','ⱼ') | |
1143 call s:SuperSub('texSubscript','_','k','ₖ') | |
1144 call s:SuperSub('texSubscript','_','l','ₗ') | |
1145 call s:SuperSub('texSubscript','_','m','ₘ') | |
1146 call s:SuperSub('texSubscript','_','n','ₙ') | |
1140 call s:SuperSub('texSubscript','_','o','ₒ') | 1147 call s:SuperSub('texSubscript','_','o','ₒ') |
1148 call s:SuperSub('texSubscript','_','p','ₚ') | |
1149 call s:SuperSub('texSubscript','_','r','ᵣ') | |
1150 call s:SuperSub('texSubscript','_','s','ₛ') | |
1151 call s:SuperSub('texSubscript','_','t','ₜ') | |
1141 call s:SuperSub('texSubscript','_','u','ᵤ') | 1152 call s:SuperSub('texSubscript','_','u','ᵤ') |
1153 call s:SuperSub('texSubscript','_','v','ᵥ') | |
1154 call s:SuperSub('texSubscript','_','x','ₓ') | |
1142 call s:SuperSub('texSubscript','_',',','︐') | 1155 call s:SuperSub('texSubscript','_',',','︐') |
1143 call s:SuperSub('texSubscript','_','+','₊') | 1156 call s:SuperSub('texSubscript','_','+','₊') |
1144 call s:SuperSub('texSubscript','_','-','₋') | 1157 call s:SuperSub('texSubscript','_','-','₋') |
1145 call s:SuperSub('texSubscript','_','/','ˏ') | 1158 call s:SuperSub('texSubscript','_','/','ˏ') |
1146 call s:SuperSub('texSubscript','_','(','₍') | 1159 call s:SuperSub('texSubscript','_','(','₍') |
1152 call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') | 1165 call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') |
1153 call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') | 1166 call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') |
1154 call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') | 1167 call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') |
1155 call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') | 1168 call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') |
1156 call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') | 1169 call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') |
1170 | |
1157 delfun s:SuperSub | 1171 delfun s:SuperSub |
1158 endif | 1172 endif |
1159 | 1173 |
1160 " Accented characters: {{{2 | 1174 " Accented characters: {{{2 |
1161 if s:tex_conceal =~# 'a' | 1175 if s:tex_conceal =~# 'a' |