Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 757
David Wolever Avatar asked Apr 24 '11 18:04

David Wolever


2 Answers

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

like image 120
Peter Rincker Avatar answered Nov 15 '22 07:11

Peter Rincker


I believe it's :drop filename

like image 20
YXD Avatar answered Nov 15 '22 09:11

YXD