Ⅰ. 插件描述
Pipe a vim buffer through an external command and view the results in a scrollbind splitⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'smkent/vim-pipe-preview'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'smkent/vim-pipe-preview'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'smkent/vim-pipe-preview'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/smkent/vim-pipe-preview
Ⅳ. 文档说明
# vim-pipe-preview
vim-pipe-preview provides a way to pipe a buffer through an external command
and display the output in a separate split, which scrolls together with the
source buffer.
This plugin can pipe buffer contents through any command that reads from
standard input and returns results on standard output. My original motivation
for writing this plugin was to preview Markdown files using
terminal_markdown_viewer
within vim.
This plugin was developed and tested on Linux.

Installation
To install with vim-plug,
add an entry to your ~/.vimrc:
Plug 'smkent/vim-pipe-preview'Restart vim (or reload your ~/.vimrc) and run :PlugInstall.
Dependencies
If AnsiEsc is installed, ANSI
color escape codes will be evaluated in the preview window automatically.
Configuration and Usage
Specify the external pipe command to be used by settingg:pipe_preview_command.
For example, to preview using
terminal_markdown_viewer,
set the following in your ~/.vimrc:
let g:pipe_preview_command = 'mdv -'Preview a buffer with the configured external command by running:
:PipePreviewOnce the preview window is active, its contents will be updated automatically
using the configured external command each time the parent buffer is saved.
The :PipePreview command may also be mapped for easier use. For example:
nnoremap <silent> ,pp :<C-U>PipePreview<CR>Please see the vim-pipe-preview help file for full
documentation.
Inspiration
This was partially inspired by
vim-fugitive; particularly :Gblame
which creates a [scrollbind
window](http://vim.wikia.com/wiki/Scrolling_synchronously) with git blame
output.
License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
See LICENSE for the full license text.