1

我正在使用 vim 编辑器并使用vsplit. 我按A B C顺序有 3 个垂直拆分窗口。是否可以洗牌B A C订购窗口?

4

3 回答 3

4

用于<ctrl-w> + H将当前选定的窗口移动到最左侧(大写 H)

因此,如果您的光标位于窗格 B 中,您可以<c-w>H将 B 向左移动,A 将位于中间

查看:h window-moving移动窗口的其他选项。

5. Moving windows around                                window-moving


CTRL-W x                                        CTRL-W_x CTRL-W_CTRL-X
CTRL-W CTRL-X   Without count: Exchange current window with next one.  If there
                is no next window, exchange with previous window.
                With count: Exchange current window with Nth window (first
                window is 1).  The cursor is put in the other window.
                When vertical and horizontal window splits are mixed, the
                exchange is only done in the row or column of windows that the
                current window is in.

...

                                                CTRL-W_H
CTRL-W H        Move the current window to be at the far left, using the
                full height of the screen.  This works like closing the
                current window and then creating another one with
                ":vert topleft split", except that the current window contents
                is used for the new window.
                {not available when compiled without the +vertsplit feature}
于 2013-08-19T20:56:17.183 回答
3

如果要实现ABC->BAC,光标在B,做@Fdinoff 建议,如果光标在A,<c-w> +x将当前窗口与下一个交换。

我个人经常使用它,当我并排打开两个窗口并想交换它们的位置时。

<c-w> H将 H-split 两个窗口切换到 V-split 也很有用。

于 2013-08-19T21:04:37.787 回答
0

有趣的问题。如果我真的想让 vim 随机播放窗口,我会这样做:

au VimEnter * exe (localtime()%winnr('$')+1). "wincmd R|1wincmd w"
于 2013-08-20T13:37:07.133 回答