Ⅰ. 插件描述
A vim plugin that provides the function to automatically preview a given pandoc file in your favorite pdf viewerⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lynnard/pandoc-preview-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lynnard/pandoc-preview-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lynnard/pandoc-preview-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lynnard/pandoc-preview.vim
Ⅳ. 文档说明
Pandoc Preview plugin
Introduction
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
Quick start
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
.mdand press the key!
Configurations
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