vimtex/after/syntax/tex.vim

38 lines
1.3 KiB
VimL
Raw Normal View History

" Better support for cite commands
" \cite, \citep, \citet, \citeauthor, ...
syn match texRefZone
2013-12-15 07:44:36 -05:00
\ "\\\(auto\|text\)cite\%([tp]\*\=\|author\)\="
\ nextgroup=texRefOption,texCite
" Add support for cleverref package
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
2013-10-05 07:53:42 -04:00
syn 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)
syn match texStatement
\ '\\c\(page\)\?refrange\>'
2013-10-17 07:33:52 -04:00
\ nextgroup=texRefRangeStart skipwhite skipnl
syn region texRefRangeStart
\ start="{"rs=s+1 end="}"
\ matchgroup=Delimiter
\ contained contains=texRefZone
\ nextgroup=texRefRangeEnd skipwhite skipnl
syn region texRefRangeEnd
\ start="{"rs=s+1 end="}"
\ matchgroup=Delimiter
\ contained contains=texRefZone
hi link texRefRangeStart texRefZone
hi link texRefRangeEnd texRefZone
2014-02-09 09:44:55 -05:00
" Support for listings package
syn region texZone
\ start="\\begin{lstlisting}"
\ end="\\end{lstlisting}\|%stopzone\>"
syn 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-06-04 08:53:49 -04:00
syn match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"