" Vim syntax file
" Language   : TeX
" Maintainer : Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
" Last change: 1997 April 28

" Remove any old syntax stuff hanging around
syntax clear

" \begin{} ... \end{} handling
" separate lines used for verb` and verb# so that the end conditions
" will appropriately terminate
syntax region texPreCondit start="\\begin{verbatim}" end="\\end{verbatim}"
syntax region texPreCondit start="\\verb`" end="`"
syntax region texPreCondit start="\\verb#" end="#"
syntax region texPreCondit start="@samp{" end="}"
syntax region texPreCondit start="\$" skip="\\\$" end="\$"

" TeX/LaTeX keywords
" Instead of trying to be All Knowing, I just match \..alphameric..
syntax match texStatement "\\[a-zA-Z]\+"
syntax match texStatement "@[a-zA-Z]\+"
syntax match texDelimiter "{"
syntax match texDelimiter "}"
syntax match texDelimiter "\["
syntax match texDelimiter "\]"
syntax match texDelimiter "&"
syntax match texDelimiter "\\\\"

" Comments: these are always a problem...
syntax match texComment "%.*$"

" synchronizing
syntax sync match SyncComment grouphere texPreCondit "\\begin{verbatim}"
syntax sync match SyncComment groupthere NONE "\\end{verbatim}"

if !exists("did_tex_syntax_inits")
 let did_tex_syntax_inits = 1
 " The default methods for highlighting. Can be overridden later
 highlight link texComment Comment
 highlight link texDelimiter Type
 highlight link texStatement Statement
 highlight link texPreCondit PreCondit
endif
