Make gvim markdown highlight ignore internal markers

escaping, markdown, vim

Solution

The runtime files (especially if you use the old Vim 7.3.000 / 046 installer found on vim.org) aren't updated frequently. Most plugin authors publish more recent releases elsewhere, and they are only occasionally picked up by Vim.

In Tim Pope's repository, you'll find a newer version (that you can install into your `~/.vim` directory) that doesn't show the problem; instead, it even highlights the single underscore character as an error.

Problem

I recently upgraded to gvim 7.3 and was pleased to find markdown highlighting. I also noticed that it treats "internal" `_`(underscore) as a marker. For example: I want gvim to display emphasis here but not_here gvim actually displays the last line in my example as 'but not_here". It looks like SO's markdown interpretation is closer to what I want. I do not say that gvim is "wrong" because I do not know what the correct markdown implementation is. However, is there a way to configure it so that the markers should be treated as normal text if they are surrounded by non-whitespace?

Original source