vim: render plantuml

When using the plugin plantuml-syntax, add the following one-liner in .vimrc to render a PNG in the current directory when ‹leader›b is pressed:

autocmd FileType plantuml nnoremap <buffer> <leader>b :!java -jar ~/bin/plantuml.jar -o %:p:h %<cr>

This assumes Linux and that plantuml.jar lives in ~/bin. If working from a Dropbox directory, the image can then easily be viewed in a web browser.

Leave a comment