> Hi Ben!
>
> On Do, 08 Apr 2010, Ben Fritz wrote:
>
> > Executing :2wincmd w will take you to Window 2, which is displaying
> > Buffer 4. IIUC, the OP said he wants to jump to the window containing
> > BUFFER 2 in this situation, which would be Window 1.
>
> Quoting from :h bufwinnr()
>
> bufwinnr({expr}) *bufwinnr()*
> The result is a Number, which is the number of the first
> window associated with buffer {expr}. For the use of {expr},
> see |bufname()| above. If buffer {expr} doesn't exist or
> there is no such window, -1 is returned. Example: >
>
My mistake, somehow I missed the use of the bufwinnr function. Thanks
for pointing this out. With bufwinnr, your method should work fine.
Somehow I misread that you were using the buffer number itself as the
count to the wincmd. As I pointed out, if you WERE trying to use the
buffer number directly, it would not work.
Using 'switchbuf' and the :sb command would also work, as would :drop
with the file name.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
To unsubscribe, reply using "remove me" as the subject.
No comments:
Post a Comment