2

Sorry if this is the wrong place to ask this, I'm new to the site :/ I asked the same question in TeX StackExchange, and I was pointed here.

My issue is this: when editing in vim, my syntax file highlights underscores and carets when found in non-math text, which is fine, except vim doesn't recognize that "align" is a math environment.

A user in TeX StackExchange suggested that I take a look at my tex.vim syntax file. I don't have one in ~/.vim, but I do have one in /usr/share/vim/vim74/syntax/. There seems to be no real difference in the way align and equation are treated in the syntax file, yet Vim highlights only equation and not align. How might I fix this?

how do I fix this??

2

1 Answer 1

1

This may or may not apply to you since you're using vim version 7.4, but the following is true for the current vim version (8.0.1525 as I write this).

Sometime recently, syntax support for LaTeX packages such as amsmath was removed from the default syntax files. As far as I know these syntax files are now only available here http://www.drchip.org/astronaut/vim/; scroll down to "Latex Package Support" (or direct link to plugin vimball for amsmath).

Alternatively, you can install a different latex filetype plugin which has support for amsmath syntax, for example vimtex. This plugin does much more than just syntax highlighting though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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