Sometimes, when I'm using the torte colorscheme and editing latex files, my latex expressions inside of $ signs show up in yellow. When this happens, my underscores disappear, as the following figure illustrates (what's written here is actually $a_1$):

Example figure

For other latex files (I haven't yet figured out what makes the difference) the same expression would show up in a different color and the underscore would be visible: so there's something wierd going on with yellow. All my other symbols show up fine.

Is there any way to fix this, so that I can see the underscores, even in yellow? Thanks!

  • could something be with the filetyp detection, have you tried running :set ft? on the incorrect, and a correct file and confirm that it is the same ? – Doktor OSwaldo Feb 15 '17 at 7:25
  • For some reason, today I can't replicate the problem!! (In fact, it was only yesterday that the problem showed up.) I will try this next time I have the problem again. – Leo Simon Feb 15 '17 at 18:28
  • You can reproduce by opening an empty buffer in Vim, then do: set ft=plaintex and write $a_1$. – Karl Yngve Lervåg Feb 15 '17 at 22:02
  • That does enable me to replicate the problem, unfortunately set ft=latex doesn't fix it. Nor does g:tex_flavor = 'latex' – Leo Simon Feb 16 '17 at 17:58

This is probably because the filetype is set to plaintex instead of tex. You can "force" Vim to always use the tex filetype with:

let g:tex_flavor = 'latex'

See :h g:tex_flavor for more info.

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.