Merge branch 'master' into math-mappings

This commit is contained in:
Karl Yngve Lervåg 2015-08-31 08:17:28 +02:00
commit 7239aaebef

View File

@ -9,14 +9,27 @@ if !exists('b:current_syntax') || b:current_syntax !=# 'tex'
finish finish
endif endif
" Better support for cite commands " {{{1 Add syntax highlighting for \url and \href
" \cite, \citep, \citet, \citeauthor, ... syntax match texStatement '\\url' nextgroup=texUrl
syntax match texRefZone syntax match texStatement '\\href' nextgroup=texHref
syntax region texUrl matchgroup=Delimiter start="{" end="}" contained
syntax region texHref matchgroup=Delimiter start="{" end="}" contained
\ nextgroup=texHrefLinkText
syntax region texHrefLinkText matchgroup=Delimiter start="{" end="}" contained
\ contains=@Spell
highlight link texUrl Function
highlight link texHref texUrl
highlight link texHrefLinkText texSectionZone
" }}}1
" {{{1 Improve support for cite commands
syntax match texStatement
\ "\\\%(auto\|text\)\?cite\%([tp]\*\?\|author\)\?" \ "\\\%(auto\|text\)\?cite\%([tp]\*\?\|author\)\?"
\ nextgroup=texRefOption,texCite \ nextgroup=texRefOption,texCite
" Add support for cleveref package " }}}1
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref " {{{1 Add support for cleveref package
syntax region texRefZone matchgroup=texStatement syntax region texRefZone matchgroup=texStatement
\ start="\\\(\(label\)\?c\(page\)\?\|C\|auto\)ref{" \ start="\\\(\(label\)\?c\(page\)\?\|C\|auto\)ref{"
\ end="}\|%stopzone\>" \ end="}\|%stopzone\>"
@ -35,10 +48,12 @@ syntax region texRefRangeEnd
\ start="{"rs=s+1 end="}" \ start="{"rs=s+1 end="}"
\ matchgroup=Delimiter \ matchgroup=Delimiter
\ contained contains=texRefZone \ contained contains=texRefZone
highlight link texRefRangeStart texRefZone highlight link texRefRangeStart texRefZone
highlight link texRefRangeEnd texRefZone highlight link texRefRangeEnd texRefZone
" {{{1 Support for listings package " }}}1
" {{{1 Add support for listings package
syntax region texZone syntax region texZone
\ start="\\begin{lstlisting}"rs=s \ start="\\begin{lstlisting}"rs=s
\ end="\\end{lstlisting}\|%stopzone\>"re=e \ end="\\end{lstlisting}\|%stopzone\>"re=e