David Wolever
David Wolever

Reputation: 154672

How to switch to the buffer where the file with a given name is opened in Vim?

Is there a function in Vim which will switch to a buffer? For example, if I know that I have the TODO.txt file open in some window in some tab, I’d like to jump to that tab and focus that window. Is that possible?

Upvotes: 7

Views: 962

Answers (3)

Peter Rincker
Peter Rincker

Reputation: 45177

set swb=useopen,usetabe will set make :sb [number] or :sb [pattern] switch to an open window in whichever tab.

Upvotes: 8

sehe
sehe

Reputation: 393924

I use

 :buf TODO

you need a unique identifiying piece of the buffers filename. You can use tab-completion, though :)

Oh IC, just noted that you want to activate the corresponding tab. Sry

Upvotes: 0

YXD
YXD

Reputation: 32521

I believe it's :drop filename

Upvotes: 3

Related Questions