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.
Simply cp bufferhint.vim ~/.vim/plugin/
.
Or if you use pathogen, just mkdir -p ~/.vim/bundle/bufferhint/plugin/
,
and throw bufferhint.vim in that directory.
After that, add following two lines in your "~/.vimrc":
nnoremap - :call bufferhint#Popup()<CR>
nnoremap \ :call bufferhint#LoadPrevious()<CR>
Done.
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 byvim -S
command in the future. The name of the session file is "session.vim" by default, it can be specified by settingg:bufferhint_SessionFile
.
-
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, forPGUP/PGDN/C-f/C-b
. -
g:bufferhint_SessionFile
Session file name. -
g:bufferhint_KeepWindow
Keep window after usingd
to delete buffer if it's been set to 1.
If you like this plugin, please rate it here!