Ⅰ. 插件描述
Handy buffer switcher for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'bsdelf/buffer-hint'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'bsdelf/buffer-hint'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'bsdelf/buffer-hint'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/bsdelf/bufferhint
Ⅳ. 文档说明
# Buffer Hint
bufferhint is a handly buffer switcher for Vim.
With this plugin, you can browse all buffers in a popup side window.
In addition, this plugin provides a "hint key" for each buffer, just like what Vimperator/Vimium/VimFx does.
Therefore, you can switch among buffers quickly with a single key stroke in the best case.
Installtion
Manually
cp bufferhint.vim ~/.vim/plugin/Pathogen
cd ~/.vim/bundle
git clone https://github.com/bsdelf/bufferhint.gitConfiguration
Add following two lines in ~/.vimrc:
nnoremap - :call bufferhint#Popup()
nnoremap \ :call bufferhint#LoadPrevious()Usage
Basic usage
vim foo.txt bar.txt doe.txt.- Type
-to popup bufferhint window. - Type
j,k,C-f,C-b,PGUP,PGDNto navigate. - Type
ENTERto load the buffer under cursor.
Load buffer by hint
vim foo.txt bar.txt doe.txt.- Type
-to popup bufferhint window. - Type
bto load "bar.txt". - Type
\to load the previous buffer namely "foo.txt".
Switch sort mode
- Type
-to popup bufferhint window. - Type
SPACEto switch sort mode.
Delete buffers
vim foo.txt bar.txt doe.txt.- Type
-to popup bufferhint window. - Type
ddto delete the buffer under cursor. - Type
dbto delete a buffer by hint.
Notes
- Yellow hints means the buffers are sorted by path, green hints means the buffers are sorted by LRU.
- You can also type
/in bufferhint window and search what you want, then typeENTERto load it. - Apparently
j/k/d/n/Nare excluded from the hint chars.
Functions
bufferhint#Popup()Toggle bufferhint window.bufferhint#LoadPrevious()Load the second item in LRU. It's very useful in the scene where you want to switch back and forth between two files.bufferhint#Save()Save current session to an external session file which can be restored by `vim -S` command in the future. The default session file name is "session.vim".
Preference
g:bufferhint_SortModeDefault sort mode.
- 0: sort by path
- 1: sort by LRU
g:bufferhint_MaxWidthMaxmium window width.
g:bufferhint_PageStepPage step, will affect
PGUP,PGDN,C-f,C-b.g:bufferhint_SessionFileThe default session file name.
g:bufferhint_KeepWindowSet to
1to keep window open after buffer deleting.
Screenshot

One More Thing
If you like this plugin, please rate it here!