May 06 2011
∞
How to preview a Markdown document in Vim
I write a lot of stuff in Markdown using TextMate. Now I’m using Vim, but I need a way to preview what the Markdown will look like.
There are several Vim plug-ins that can do this, but all have limitations. For example, this one is nice, but it requires Ruby and doesn’t properly deal with embedded Unicode characters.
So I wrote my own Vim plug-in that previews Markdown documents. It is tested on Mac OS X and Windows (and should work on Linux, though I don’t have a GUI-based Linux box to test on). It works even if your document contains Unicode text.
The only prerequisite is that you have a markdown command installed (Discount, python-markdown, or John Gruber’s original are good choices).