vimtex/after/syntax/tex.vim

60 lines
1.8 KiB
VimL
Raw Normal View History

2014-07-22 18:08:57 -04:00
" LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
" Better support for cite commands
" \cite, \citep, \citet, \citeauthor, ...
2014-12-25 14:35:47 -05:00
syntax match texRefZone
2014-07-30 04:59:56 -04:00
\ "\\\%(auto\|text\)\?cite\%([tp]\*\?\|author\)\?"
\ nextgroup=texRefOption,texCite
" Add support for cleverref package
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
2014-12-25 14:35:47 -05:00
syntax region texRefZone matchgroup=texStatement
\ start="\\\(\(label\)\?c\(page\)\?\|C\)ref{"
2013-10-05 07:53:42 -04:00
\ end="}\|%stopzone\>"
\ contains=@texRefGroup
" \crefrange, \cpagerefrange (these commands expect two arguments)
2014-12-25 14:35:47 -05:00
syntax match texStatement
\ '\\c\(page\)\?refrange\>'
2013-10-17 07:33:52 -04:00
\ nextgroup=texRefRangeStart skipwhite skipnl
2014-12-25 14:35:47 -05:00
syntax region texRefRangeStart
2013-10-17 07:33:52 -04:00
\ start="{"rs=s+1 end="}"
\ matchgroup=Delimiter
\ contained contains=texRefZone
\ nextgroup=texRefRangeEnd skipwhite skipnl
2014-12-25 14:35:47 -05:00
syntax region texRefRangeEnd
2013-10-17 07:33:52 -04:00
\ start="{"rs=s+1 end="}"
\ matchgroup=Delimiter
\ contained contains=texRefZone
2014-12-25 14:35:47 -05:00
highlight link texRefRangeStart texRefZone
highlight link texRefRangeEnd texRefZone
2014-02-09 09:44:55 -05:00
" Support for listings package
2014-12-25 14:35:47 -05:00
syntax region texZone
2014-02-09 09:44:55 -05:00
\ start="\\begin{lstlisting}"
\ end="\\end{lstlisting}\|%stopzone\>"
2014-12-25 14:35:47 -05:00
syntax match texInputFile
2014-06-04 08:53:49 -04:00
\ "\\lstinputlisting\s*\(\[.*\]\)\={.\{-}}"
2014-02-09 09:44:55 -05:00
\ contains=texStatement,texInputCurlies,texInputFileOpt
2014-12-25 14:35:47 -05:00
syntax match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"
" Nested syntax highlighting for dot
let s:current_syntax=b:current_syntax
unlet b:current_syntax
syntax include @DOT syntax/dot.vim
syntax region texZone
\ matchgroup=texRefZone
\ start="\\begin{dot2tex}"
\ matchgroup=texRefZone
\ end="\\end{dot2tex}"
\ keepend
\ transparent
\ contains=@DOT
let b:current_syntax=s:current_syntax
2014-12-08 14:44:17 -05:00
" vim: fdm=marker sw=2