On Fri, Nov 13, 2009 at 10:01:28AM EST, anna wrote:
>
> If we split the vim to open many buffers, we can change the cursor
> focus using mouse or pressing <CTRL-W><CTRL-W>.
> When I jump the cursor focus to other buffer, I want the opened buffer
> is still there.
> If we use :b + buffer number, this will make replace the current
> display to other buffer.
> For example, we have 2 buffers opened. Buffer1 is on top, and buffer2
> is at the bottom. When the cursor focus is at buffer1, then we
> execute :b 2. Then both will show buffer2.
> I don't want this to happen. I just want the cursor focus move to
> buffer2.
> Using <CTRL-W><CTRL-W> is one solution. However, I want it jump
> directly to a certain buffer, without traversing through buffers
> sequentially.
>
> Any idea?
Yes, you shouldn't talk about buffers when you mean windows. ;-)
.--------------.--------------.--------------.
|1 |4 |6 |
| | | |
| | | |
.--------------. | |
|2 | | |
| .--------------. |
| |5 | |
.--------------. | |
|3 | | |
| | .--------------.
| | |7 |
.--------------.--------------.--------------.
With this layout and cursor in (1) you can go to (3) with Ctrl-W 3j,
then go back to (1) with Ctrl-W 3k.
Likewise you can go to (6) with Ctrl-W 3l and back with Ctrl-W 3h.
See :h window-move-cursor for details.
Not sure you can go directly from (1) to (7) unless you follow the
example in :h wincmd and map the :exe window_number . "wincmd w" to
something sensible.
Try it first from the command line and see if it works for you.
:exe 7 . "wincmd w"
:exe 2 . "wincmd w"
etc.
CJ
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---