vim-markdown-preview
NOTE: This repository is deprecated, and I don't really use/maintain this plugin anymore. I've replaced it with markdown-preview.nvim.
vim-markdown-preview adds the option to preview markdown documents in the browser (using HTML) from the vim editor, or to export to MS Word or PDF.
If previewing as HTML, the plugin uses bootstrap and jQuery to provide some basic styling. If previewing as MS Word/PDF, the plugin uses pandoc to convert.
Install
Install using any standard plugin
manager.
You then need to run npm install
.
Usage
Map the functions vim_markdown_preview#ConvertMarkdownToHTML()
and
vim_markdown_preview#ConvertMarkdownToDocX()
to keystrokes in your ~/.vimrc
:
autocmd FileType markdown nnoremap <buffer> <Leader>Ch :call vim_markdown_preview#ConvertMarkdownToHTML()<CR>
autocmd FileType markdown nnoremap <buffer> <Leader>Cw :call vim_markdown_preview#ConvertMarkdownToDocX()<CR>
autocmd FileType markdown nnoremap <buffer> <Leader>cp :call vim_markdown_preview#ConvertMarkdownToPDF()<CR>
Dependencies
- vim
- pandoc (needs a separate install) - for Markdown-to-MSWord or PDF
Credit
-
Mathias Billman This is an enitrely rewritten version of the vim script originally written by Mathias Billman and found here.
-
moreweb Contributor.
-
maba Contributor.
-
Andrew Ferrier Forked and refreshed to work with Microsoft Word, as well as updating HTML approach.