Sunday, August 14, 2011

Re: Is there anyway that Vim can 'tag' or 'name' a window for future reference?

As soon as I learned there is a 'winnr()' built-in function,
everything is easy now.

'winnr()' is a bit problematic since the window number is not stable
(if you create a new window, the existing window's number may change)
but I can work around it.

Thanks to all for the answers.

On Sun, Aug 14, 2011 at 7:26 AM, Ben Schmidt
<mail_ben_schmidt@yahoo.com.au> wrote:
>> The problem I have is: the more I work on this window layout, the more
>> I feel that Vim lacks of facilities to identify windows, for example,
>> if I want to implement a customized command to exchange the files
>> between current window and window 1, I don't have a straightforward
>> way to identify the current window number, which is a major obstacle
>> to develop more sophisticated commands on this layout.
>
> How about
>
> :exec winnr()."wincmd x"
>
> ?
>
> :help :wincmd
> :help winnr()
> :help CTRL-W_x
>
> Ben.
>
>
>
>

--
张小潘

--
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

No comments: