How do you quickly access a particular buffer (amongst a long list of
buffers) in vim? For ages, i’ve been using :ls
, followed by :b<id>
,
where <id>
is the id of a particular buffer.
Recently, i’ve discovered yet another way to acheive it using
BufExplorer
,
to install it, download the
latest version
& save it to ~/.vim/bundle
, then:
1 2 |
|
Restart your vim, open several files, & try \be
(backslash + b + e),
you are then presented with BufExplorer
, & within it, u can goto a
specific buffer with:
- search with
/
, followed byenter
, or - goto that line with
:<lineno>
, followed byenter
, or - simply
:b<id>
If you want to be able to goto BufExplorer
by doing CTRL-b
, just add
the following line to ur ~/.vimrc
:
1
|
|
Alternatively, you may wanna remap how the command :ls
works by doing
the following instead:
1
|
|
If you prefer loading BufExplorer
in horizontal or vertical split, you
may wanna try:
\bs
(backslash + b + s) for horizontal split\bv
(backslash + b + s) for vertical split
Pick the one u like & have fun !!