Vim: adjust tex equation selection

How to get vim to highlight the following environment:

\begin{dmath*}
  2 + 2
\end{dmath*}

as well as

\begin{equation*}
 2 + 2
\end{equation*}

?

ie I want the environments dmath(in its simple and star versions) to be allocated in the same ways as the environment equation(regular and marked).

enter image description here

+4
source share
1 answer

I inserted your question into Vim, :setf texand then used SyntaxAttr.vim - show the syntax highlighting the attributes of the symbol under the cursor plugin to find out what the name of the corresponding syntax group is texMathZoneES.

Then I opened $VIMRUNTIME/syntax/tex.vimand looked for it. I did not find this directly, but something like this:

call TexNewMathZone("E","equation",1)

:help ft-tex-syntax ( <C-D>) :help tex-math . :

call TexNewMathZone("M","dmath",1)

~/.vim/after/syntax/tex.vim, , . , ?!

+7

All Articles