7

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?

3 Answers 3

8

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

Sign up to request clarification or add additional context in comments.

2 Comments

Hrm… Either things have changed in 7.3 (I'm on 7.2), or swb doesn't quite do what I want. In 7.2, it seems like swb is only checked when jumping to errors and using quickfix and stuff. When I've got set swf=useopen,usetab, running :b foo still replaces the current window with the buffer matching foo.
@David Wolever, your absolutely correct. You should be using :sb instead of :b. I have corrected the post.
3

I believe it's :drop filename

1 Comment

Hhmm… Close, although that requires the full path to the file, which kind of sucks if you've got a bunch of files open (where as, with buffers, you can tab-complete fairly easily).
0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.