pandoc-preview.vim is just a minimalistic plugin that I use personally for previewing pandoc. There are two commands that come with the plugin:
PandocPreview
: compile the pdf file and launch it with the configured pdf reader; after that each time the file is written the pdf will be updatedPandocCompile
: compile the pdf file only
-
Configure your pdf reader by adding this to your .vimrc (this step is quite necessary as the default might not exist in your system):
let g:pandoc_preview_pdf_cmd = "zathura"
-
Add a keybinding (for best effect put it in
~/.vim/ftplugin/{markdown.vim, pandoc.vim}
):nnoremap <leader>v :PandocPreview<cr>
-
Now open a
.md
and press the key!
The following variables can be changed as you like
g:pandoc_preview_pdf_cmd
: the cmd used to open the pdfg:pandoc_path
: the path to your pandoc binaryg:pandoc_generate_pdf_dir
: the directory where the generated pdf will be put; default to the same directory as the file currently being edited