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.
cp bufferhint.vim ~/.vim/plugin/
cd ~/.vim/bundle
git clone https://github.com/bsdelf/bufferhint.git
Add following two lines in ~/.vimrc
:
nnoremap - :call bufferhint#Popup()
nnoremap \ :call bufferhint#LoadPrevious()
vim foo.txt bar.txt doe.txt
.- Type
-
to popup bufferhint window. - Type
j
,k
,C-f
,C-b
,PGUP
,PGDN
to navigate. - Type
ENTER
to load the buffer under cursor.
vim foo.txt bar.txt doe.txt
.- Type
-
to popup bufferhint window. - Type
b
to load "bar.txt". - Type
\
to load the previous buffer namely "foo.txt".
- Type
-
to popup bufferhint window. - Type
SPACE
to switch sort mode.
vim foo.txt bar.txt doe.txt
.- Type
-
to popup bufferhint window. - Type
dd
to delete the buffer under cursor. - Type
db
to delete a buffer by hint.
- 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 typeENTER
to load it. - Apparently
j/k/d/n/N
are excluded from the hint chars.
-
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".
-
g:bufferhint_SortMode
Default sort mode.
- 0: sort by path
- 1: sort by LRU
-
g:bufferhint_MaxWidth
Maxmium window width.
-
g:bufferhint_PageStep
Page step, will affect
PGUP
,PGDN
,C-f
,C-b
. -
g:bufferhint_SessionFile
The default session file name.
-
g:bufferhint_KeepWindow
Set to
1
to keep window open after buffer deleting.
If you like this plugin, please rate it here!