In a tex file, almost all the characters inside delimiters like $...$ or \[...\] have the same color, but there are some characters, like = (and possibly others) which have a different color. I would like to change the syntax so that everything inside math delimiters has the same color. For example, in the picture below, I would like the = sign to be cyan like the other characters.

enter image description here

I have looked at the syntax\tex.vim file but haven't been able to find the proper highlighting setting. I also have vimtex, but I assume it doesn't have the syntax I want by default.

  • 2
    Well, there's texMathZone with a letter, and (for me) = and ^ are texMathOper. Are you using dracula, btw? The equation characters are purple for me, not cyan.
    – D. Ben Knoble
    Nov 5 '20 at 16:56
  • @D.BenKnoble thank you, very helpful! Yes I have your theme but I have tried to tinker with it in my vimrc. Nov 5 '20 at 17:20

Create a new file under VIM_RUNTIME_PATH/syntax, maybe ~/.vim/sytax


syn clear texMathOper
  • 1
    I'm not sure I understand your answer, but thank you for telling me what the highlight variable is. I have changed it with autocmd ColorScheme. Nov 5 '20 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.