Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: jump to buffer

Tags:

vim

I have 2 tabs with 4 opened buffes:

tab1                   tab2   
===================    ===================
|:buf1   |:buf2   |    |:buf3   |:buf4   |
|        |        |    |        |        |
|        |        |    |        |        |
|        |        |    |        |        |
===================    ===================

Assume that :buf4 is currently active. How I can quickly find :buf2 buffer and jump into? As result I should be in the tab1 :buf2.

like image 290
ole Avatar asked Dec 18 '25 01:12

ole


1 Answers

With this option:

set switchbuf=useopen,usetab

you can use:

:sb2

to jump to buffer number 2 wherever it is currently displayed.

See :help :sb and :help switchbuf.

Note, however, that windows and tabs are added interaction layers that don't work well with regular buffer commands. With your layout I would simply do gt and possibly <C-w>w.

like image 135
romainl Avatar answered Dec 20 '25 16:12

romainl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!