Sergey Potapov

A word from rustacean, rubist and linuxoid.

Vim Preview Plugin


Preview plugin is a tool developed to help you to preview markup files such as .markdown, .rdoc, .textile, .ronn and .html when you are editing them. It builds html files and opens them in your browser.

Supported Formats

The plugin supports the next formats:

  • markdown(md, mkd, mkdn, mdown) - depends on bluecloth ruby gem
  • rdoc - depends on github-markup ruby gem
  • textile - depends on RedCloth ruby gem
  • html(htm)
  • ronn - depends on ronn ruby gem


The plugin requires a builtin ruby interpreter. It means that your Vim should be compiled with --enable-rubyinterp option. To find out does you Vim have builtin ruby interpreter you can do the next:

:echo has('ruby')

If output is 1 the ruby interpreter is builtin.

The second thing you should verify is that you have installed all necessary ruby gems. Please see “Supported Formats” section to find out what gems you need.


At first you should get the plugin. You can clone my repository from github like this:

git clone git://

Or download it from

To install the plugin just copy autoload, plugin, doc directories into your .vim directory:

cd vim-preview
cp ./autoload ~/.vim -R
cp ./plugin ~/.vim -R
cp ./doc ~/.vim -R

If you use Pathogen just unzip/clone the plugin to ~/.vim/bundle directory. If don’t use Pathogen, I would recommend you to start.


  • <Leader>P - will open current file converted to HTML in your browser.

I want to remind that <Leader> in most cases is \ key.

To get more information about the plugin and how it can be customized read help in Vim editor:

:help Preview

If you found a bug …

Report it me!