I write a lot of stuff in Markdown: this site (and others), general notes, and most of my note taking for work. Previewing your text is useful at times. Enter Marked. You open up the file you are editing in Marked and it keeps watch of it, automatically updating the preview whenever you save. Over the years, I’ve used a variety of Markdown previewers, from BBEdit’s built in preview, to writing my own preview script (which I had to manually update), to writing a quick Vim function to preview the current file in Safari. Not only does Marked work better and look nicer with less hassle, it also has some nice features, like letting you ignore YAML front matter if you wish.

If you do a lot of writing in Markdown, do yourself a favor and pick up a copy of Marked. It’s only $3.99 at the App store (OS X only).

Calling from Vim

You can call Marked from the command line in an incredibly obvious way: open -a Marked filename. I’m sure you could write a quick one liner and stick it in your .vimrc file, but instead, I added the following to ~/vim/after/ftplugin/markdown.vim:

fun! Preview()
    silent exec "!open -a Marked %"

nmap ,p :call Preview()<CR>