2014-07-22 18:08:57 -04:00
|
|
|
" LaTeX plugin for Vim
|
|
|
|
"
|
|
|
|
" Maintainer: Karl Yngve Lervåg
|
|
|
|
" Email: karl.yngve@gmail.com
|
|
|
|
"
|
|
|
|
|
2013-11-03 05:49:18 -05:00
|
|
|
" Better support for cite commands
|
|
|
|
" \cite, \citep, \citet, \citeauthor, ...
|
|
|
|
syn match texRefZone
|
2014-07-30 04:59:56 -04:00
|
|
|
\ "\\\%(auto\|text\)\?cite\%([tp]\*\?\|author\)\?"
|
2013-11-03 05:49:18 -05:00
|
|
|
\ nextgroup=texRefOption,texCite
|
|
|
|
|
2013-10-16 04:17:08 -04:00
|
|
|
" Add support for cleverref package
|
|
|
|
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
|
2013-10-05 07:53:42 -04:00
|
|
|
syn region texRefZone matchgroup=texStatement
|
2013-10-16 04:17:08 -04:00
|
|
|
\ start="\\\(\(label\)\?c\(page\)\?\|C\)ref{"
|
2013-10-05 07:53:42 -04:00
|
|
|
\ end="}\|%stopzone\>"
|
|
|
|
\ contains=@texRefGroup
|
2013-10-16 04:17:08 -04:00
|
|
|
|
|
|
|
" \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
|
2013-10-16 04:17:08 -04:00
|
|
|
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*\(\[.*\]\)\={.\{-}}"
|