" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Last Change: Jun 29, 2020
" Version: 119
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
"
" 1. If you have a \begin{verbatim} that appears to overrun its boundaries,
" use %stopzone.
"
" 2. Run-on equations ($..$ and $$..$$, particularly) can also be stopped
" by suitable use of %stopzone.
"
" 3. If you have a slow computer, you may wish to modify
"
" syn sync maxlines=200
" syn sync minlines=50
"
" to values that are more to your liking.
"
" 4. There is no match-syncing for $...$ and $$...$$; hence large
" equation blocks constructed that way may exhibit syncing problems.
" (there's no difference between begin/end patterns)
"
" 5. If you have the variable "g:tex_no_error" defined then none of the
" lexical error-checking will be done.
"
" ie. let g:tex_no_error=1
"
" 6. Please see :help latex-syntax for information on
" syntax folding :help tex-folding
" spell checking :help tex-nospell
" commands and mathzones :help tex-runon
" new command highlighting :help tex-morecommands
" error highlighting :help tex-error
" new math groups :help tex-math
" new styles :help tex-style
" using conceal mode :help tex-conceal
" Version Clears: {{{1
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
scriptencoding utf-8
" by default, enable all region-based highlighting
let s:tex_fast= "bcmMprsSvV"
if exists("g:tex_fast")
if type(g:tex_fast) != 1
" g:tex_fast exists and is not a string, so
" turn off all optional region-based highighting
let s:tex_fast= ""
else
let s:tex_fast= g:tex_fast
endif
endif
" let user determine which classes of concealment will be supported
" a=accents/ligatures d=delimiters m=math symbols g=Greek s=superscripts/subscripts
if !exists("g:tex_conceal")
let s:tex_conceal= 'abdmgsS'
else
let s:tex_conceal= g:tex_conceal
endif
if !exists("g:tex_superscripts")
let s:tex_superscripts= '[0-9a-zA-W.,:;+-<>/()=]'
else
let s:tex_superscripts= g:tex_superscripts
endif
if !exists("g:tex_subscripts")
let s:tex_subscripts= '[0-9aehijklmnoprstuvx,+-/().]'
else
let s:tex_subscripts= g:tex_subscripts
endif
" Determine whether or not to use "*.sty" mode {{{1
" The user may override the normal determination by setting
" g:tex_stylish to 1 (for "*.sty" mode)
" or to 0 else (normal "*.tex" mode)
" or on a buffer-by-buffer basis with b:tex_stylish
let s:extfname=expand("%:e")
if exists("g:tex_stylish")
let b:tex_stylish= g:tex_stylish
elseif !exists("b:tex_stylish")
if s:extfname == "sty" || s:extfname == "cls" || s:extfname == "clo" || s:extfname == "dtx" || s:extfname == "ltx"
let b:tex_stylish= 1
else
let b:tex_stylish= 0
endif
endif
" handle folding {{{1
if !exists("g:tex_fold_enabled")
let s:tex_fold_enabled= 0
elseif g:tex_fold_enabled && !has("folding")
let s:tex_fold_enabled= 0
echomsg "Ignoring g:tex_fold_enabled=".g:tex_fold_enabled."; need to re-compile vim for +fold support"
else
let s:tex_fold_enabled= 1
endif
if s:tex_fold_enabled && &fdm == "manual"
setl fdm=syntax
endif
if s:tex_fold_enabled && has("folding")
com! -nargs=* TexFold <args> fold
else
com! -nargs=* TexFold <args>
endif
" (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1
" but _ is the only one that causes problems.
" One may override this iskeyword setting by providing
" g:tex_isk
if exists("g:tex_isk")
if b:tex_stylish && g:tex_isk !~ '@'
let b:tex_isk= '@,'.g:tex_isk
else
let b:tex_isk= g:tex_isk
endif
elseif b:tex_stylish
let b:tex_isk="@,48-57,a-z,A-Z,192-255"
else
let b:tex_isk="48-57,a-z,A-Z,192-255"
endif
if (v:version == 704 && has("patch-7.4.1142")) || v:version > 704
exe &q