Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I edit a .markdown file in vim, the highlighting looks like this:

enter image description here

I am using a light colour scheme and the builtin vim .markdown settings (no plugins - I found them to be worse). The problem is it is interpreting anything between _..._ as italic text, and for some reason inverting the colours to white on black. Obviously even for the parts that aren't latex I don't want the inverse colours.

How can I turn off the inverse-colour highlighting for things between _..._?

share|improve this question
up vote 1 down vote accepted

:syn list shows you all syntax definitions; the group for _this_ is markdownItalic. To change the visual appearance, just link this syntax group to a different highlight group (:hi lists them all), e.g. to turn off the highlighting:

hi link markdownItalic Normal

You can put that into your ~/.vimrc to make it permanent. You may want to consider switching to a high-color terminal (if possible); it looks like you're running with very few (2 / 16) colors.

share|improve this answer
Perfect, thanks. I am using a high colour terminal, but unfortunately it doesn't render italics :) – Andrew May 28 '14 at 17:21

It looks like you have Tex fragments inside your Markdown document. An alternative approach would highlight those with the correct syntax. My SyntaxRange plugin allows to highlight just those regions as Tex, e.g.:

:11,42SyntaxRange tex
share|improve this answer
Hmm, I would need some way of detecting the ranges automatically based on $, $$, \[ etc. Sounds like a good project at some stage. – Andrew May 30 '14 at 7:52
The plugin also has an API that lets you specify start and end patterns for the (Tex) range. The command from the answer is mostly for manual definition of a range. – Ingo Karkat May 30 '14 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .