1

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 _..._?

2 Answers 2

1

: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.

1
  • Perfect, thanks. I am using a high colour terminal, but unfortunately it doesn't render italics :)
    – Flash
    Commented May 28, 2014 at 17:21
1

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
2
  • Hmm, I would need some way of detecting the ranges automatically based on $, $$, \[ etc. Sounds like a good project at some stage.
    – Flash
    Commented May 30, 2014 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. Commented May 30, 2014 at 8:14

You must log in to answer this question.

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