Reputation: 1344
I have a bit of a strange problem with [La]TeX syntax highlighting in vim. vim seems to randomly switch between three different syntax highlighting styles, with little rhyme or reason. It doesn't appear to do this for other languages, though I haven't written anything except LaTeX (using syntax highlighting) for a while now.
So: a bit of background. This problem started becoming noticeable when I switched terminal emulators (to urxvt
), but it also appears in roxterm
, konsole
, and gnome-terminal
.
Playing around with the value of the TERM
environment variable does appear to affect the result: changing TERM
from the default of rxvt-unicode-256color
to xterm
or linux
appears to make vim not choose the third, but the first two appear to be selected at random.
I've done some Googling, to no avail. My google-fu is perhaps weak, and I apologize if this is a common problem that I've managed to overlook . . .
For reference, what the three styles look like in a sample document:
Any thoughts or suggestions would be much appreciated.
Upvotes: 1
Views: 1332
Reputation: 106
According to this website, for TeX files, Vim scans the file and guesses whether it is LaTeX, ConTeXt, or plain TeX based on the keywords used therein. Now this is a guess, but maybe every once in a while, while you're editing, you're adding or removing some keyword that is causing it to change its guess each time.
Upvotes: 3