I have some "buffer bar" at the top, showing my buffers like tabs in a browser.
In a browser I can ctrl-1, ctrl-2 etc. to jump to tabs.
What can I do in vim to jump to the buffer I want really quickly?
I have some "buffer bar" at the top, showing my buffers like tabs in a browser.
What can I do in vim to jump to the buffer I want really quickly?
Since there is no built-in "buffer bar" in Vim you must have installed a third-party plugin which, hopefully, comes with some documentation. Did you read it? Since you didn't tell us what plugin you use we can only answer with built-in commands.
The built-in command for navigating to buffer 6 is :b6
. If you don't know a buffer's number you can:
:bn[ext]
and :bp[revious]
,:ls
(or :buffers
, or :files
, the three are synonymous) followed by :b6
,:b foo<Tab>
.The last method being the most efficient and scalable.
Oh I just checked with
:buffers
, and the buffers I have open have the numbers5
,6
,9
, etc. all random. How do I choose from these?
No, buffer numbers are not "random" at all. When a buffer is added to the buffer list it is assigned a fixed number that's equal to the number of the last buffer in the list plus 1. The holes in your list are either due to:
:ls!
,