Hammer.vim can translate a bunch of markup languages to HTML, and preview them in your browser of choice. All from within vim!
By default, the preview is a clone of how GitHub would render README.md, but custom templates of your own are supported too.
This project was formerly vim-markdown-preview.
Anything github-markup supports:
- .markdown --
gem install redcarpet
- .textile --
gem install RedCloth
- .org --
gem install org-ruby
- .creole --
gem install creole
- .mediawiki --
gem install wikicloth
- .rst --
- .asciidoc --
brew install asciidoc
- .pod --
Pod::Simple::HTMLcomes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
- .1 -- Requires
- vim built with Ruby support.
- github-markup (See install instructions)
- You might need to install an extra dependency depending on the markup language you want to render (See Above).
$ [sudo] gem install github-markup $ git clone git://github.com/robgleeson/hammer.vim.git $ cp -R hammer.vim/plugin/* $HOME/.vim/plugin
:Hammer command will try to draw a preview of whatever file is currently in your buffer.
It helps to map it to a key though, and I personally use:
map <leader>p :Hammer<CR>
There are a few options, too:
The template to render with. Default is
default, a GitHub-esque design.
Where previews are written to.
%TEMP%on Windows, and
/tmpon everything else.
The template to open the preview with. Default is OS-dependent.
starton Windows, and
xdg-openon xorg-running machines.
If you don't like the default template, you can write your own.
Templates are ERB layouts with rendered markup passed on as a partial.
Templates have access to paths used by Hammer, so you can link to assets(CSS, etc) easily.
The default template serves as a good example to get you going.
Pull requests for new templates would be awesome ;-)
Many thanks to the @github team for github-markup!