syntax highlighting - Vim: customize tex equation highlight -
how force vim highlight following environment:
\begin{dmath*} 2 + 2 \end{dmath*}
the same way
\begin{equation*} 2 + 2 \end{equation*}
?
i.e want dmath
environments (in plain , starred versions) highlighted same ways equation
(plain , starred) environment.
i pasted question vim, :setf tex
, , used syntaxattr.vim - show syntax highlighting attributes of character under cursor plugin find out corresponding syntax group name texmathzonees
.
then opened $vimruntime/syntax/tex.vim
, searched it. didn't find directly, this:
call texnewmathzone("e","equation",1)
then looked :help ft-tex-syntax
(completed command-line via <c-d>
), , found under :help tex-math
nice documentation. that, created following solution:
call texnewmathzone("m","dmath",1)
you can put ~/.vim/after/syntax/tex.vim
, suggested, make permanent. easy, isn't it?!
Comments
Post a Comment