pandoc-preview.vim


Ⅰ. 插件描述

A vim plugin that provides the function to automatically preview a given pandoc file in your favorite pdf viewer

Ⅱ. 基本信息

创建日期:  2013-05-24
使用用户:  2
Github星:  4
插件作者:  Lingnan Dai

Ⅲ. 安装方法

使用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 updated
  • PandocCompile: compile the pdf file only

Quick start

  1. 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" 
  2. Add a keybinding (for best effect put it in ~/.vim/ftplugin/{markdown.vim, pandoc.vim}):

    nnoremap <leader>v :PandocPreview<cr>
  3. Now open a .md and press the key!

Configurations

The following variables can be changed as you like

  • g:pandoc_preview_pdf_cmd: the cmd used to open the pdf
  • g:pandoc_path: the path to your pandoc binary
  • g:pandoc_generate_pdf_dir: the directory where the generated pdf will be put; default to the same directory as the file currently being edited

添加新评论