bufferize.vim


Ⅰ. 插件描述

Execute a :command and show the output in a temporary buffer

Ⅱ. 基本信息

创建日期:  2016-08-07
使用用户:  5
Github星:  29
插件作者:  Andrew Radev

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'andrewradev/bufferize-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'andrewradev/bufferize-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'andrewradev/bufferize-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/andrewradev/bufferize.vim

Ⅳ. 文档说明

## Usage

The plugin exposes the :Bufferize command, which runs the given command and shows its output in a temporary buffer. For example:

:Bufferize messages
:Bufferize digraphs
:Bufferize map
:Bufferize command

All of these are examples of useful commands, whose output you can now freely explore in a proper Vim buffer.

You can provide any command sequence, with arguments and all. For instance, if you run the following command in this file:

:Bufferize ilist Bufferize

you'll get a buffer with all lines that contain "Bufferize". A lot of other commands output to the Vim console, and you can just feed them to the :Bufferize command. If you run :Bufferize command Bufferize, you'll see that the command is hooked up to the bufferize#Run function. You can then

:Bufferize function bufferize#Run

To get a listing of the function in a buffer and explore its source code.

BufferizeTimer

If you have a recent enough Vim that has +timers and +lambda (Vim 8 will do, but you can even use 7.4 with any of the later patches), you can also run the :BufferizeTimer command, which will do the same thing, but will also auto-update the buffer with the contents in the provided time interval. For instance:

BufferizeTimer 500 messages

This will run the :messages command every 500ms and update its output in the bufferize buffer.

b:bufferize_source_command

If you'd like to customize something in the bufferize buffer, you can hook into the filetype bufferize.

The buffer will also hold the variable b:bufferize_source_command which is the source command that generated this output. For instance, you could define a command to regenerate the buffer like so:

autocmd FileType bufferize
      \ command! -buffer Rerun exe 'Bufferize '.b:bufferize_source_command

Contributing

Pull requests are welcome, but take a look at CONTRIBUTING.md first for some guidelines.

添加新评论