Ⅰ. 插件描述
Unload/delete/wipe a buffer, keep its window(s), display last accessed buffer(s)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'niklasb/bufkill-vim-enchanted'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'niklasb/bufkill-vim-enchanted'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'niklasb/bufkill-vim-enchanted'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/niklasb/bufkill.vim
Ⅳ. 文档说明
This is a mirror of http://www.vim.org/scripts/script.php?script_id=1147
Basic Usage:
When you want to unload/delete/wipe a buffer, use:
:bun/:bd/:bw to close the window as well (vim command), or
:BUN/:BD/:BW to leave the window(s) intact (this script).
To move backwards and forwards through the chronological
list of buffers accessed, use :BB and :BF, respectively.
Mappings are also defined.
Detailed Description:
This is a script to
a) unload, delete or wipe a buffer without closing the window (or windows)
it was displayed inb) in its place, display the buffer most recently used in each window
it was displayed in. This selection is taken from the full list of
buffers ever displayed in each respective window (since vim was started)c) allow one level of undo in case you kill a buffer then change your mind
d) allow various customizations via option variables
Since the script maintains a list of buffer access order for each window,
commands are also provided to move backwards and forwards between
the buffers in this order, similar to going backwards and forwards in a
web browser.
The inspiration for this script came from
a) my own frustration with vim's lack of this functionality
b) the description of the emacs kill-buffer command in vimtip #622
(this script basically duplicates this command I believe,
not sure about the undo functionality)
c) comments and many mails from Keith Roberts when the issue was
raised in the vim@vim.org mailing list.