如何在vim中翻转窗口?
Possible Duplicate:
To switch from vertical split to horizontal split fast in Vim
If I have 2 horizontally split windows, how to rotate them to get 2 vertically split windows?
And how to switch buffers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您将它们垂直拆分 CwJ 将其中一个移动到底部
如果您将它们水平拆分 CwL向右移动
要在分割窗口的“列”或“行”中旋转,CwCr
If you have them split vertically C-wJ to move one to the bottom
If you have them split horizontally C-wL to move one to the right
To rotate in a 'column' or 'row' of split windows, C-wC-r
Ctrl-w H 或输入
:wincmd H
从水平布局变为垂直布局。Ctrl-w J 或输入
:wincmd J
从垂直到水平布局。Ctrl-w r 或输入
:wincmd r
来交换两个缓冲区,但保持窗口布局相同。Ctrl-w w 或输入
:wincmd w
在两个窗口/缓冲区之间移动光标。您可能希望绑定这些序列中的一个或多个以加快键入速度。我将其放入 .vimrc 中,以便 ,l 将光标移动到当前选项卡中的下一个缓冲区:
Ctrl-w H or type
:wincmd H
to go from horizontal to vertical layout.Ctrl-w J or type
:wincmd J
to go from vertical to horizontal layout.Ctrl-w r or type
:wincmd r
to swap the two buffers but keep the window layout the same.Ctrl-w w or type
:wincmd w
to move the cursor between the two windows/buffers.You may wish to bind one or more of these sequences to make it faster to type. I put this in my .vimrc so that ,l moves the cursor to the next buffer in the current tab:
CTRL-W SHIFT-H 将旋转方向,CTRL-W H 移动到左侧窗口,CTRL-W L 向右移动。请参阅
和
了解更多信息。
CTRL-W SHIFT-H will rotate the orientation, CTRL-W H moves to the left window, CTRL-W L moves to the right. See
and
for more information.
如果您只打开两个窗口,当前的答案都非常有效。如果你有更多的东西,移动窗口的逻辑就会变得很复杂。
我的 .vimrc 中有这个,允许我“猛拉”和“删除”缓冲区,然后将其粘贴到当前缓冲区上方的窗口中或作为 [v] 分割。
The current answers all work great if you only have two windows open. If you have more than that, the logic for moving windows around can get hairy.
I have this in my .vimrc to allow me to 'yank' and 'delete' a buffer and then paste it into a window over the current buffer or as a [v]split.