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 <[email protected]> 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
