如何增加 Vim 中垂直分割窗口的大小
:vsplit
(缩写::vs
)垂直分割 Vim 视口。 :30vs
分割视口,使新窗口的宽度为 30 个字符。一旦创建了这个 30 个字符的窗口,如何将其大小更改为 31 或 29?
对于水平窗口 Ctrl-W + 将行数增加一。将列加一的等效命令是什么?
:vsplit
(short form: :vs
) split the Vim viewport vertically. :30vs
splits the viewport, making the new window 30 characters wide. Once this 30 char window is created, how would one change it's size to 31 or 29?
With horizontal windows Ctrl-W + increases the number of lines by one. What is the equivalent command to increase the columns by one?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
CTRL-W >
和
CTRL-W << /kbd>
使窗口变宽或变窄。
CTRL-W >
and
CTRL-W <
to make the window wider or narrower.
并且 Ctr-W =
将使它们相等
And Ctr-W =
will make them equal
如果您还需要水平分割调整大小:
该命令对于所有拆分都是相同的,只是参数发生变化:
-
+
而不是< ;
>
示例:
减少水平尺寸 10 列
增加水平尺寸 30 列
或在正常模式下:
水平分割
10 CTRL+w -
30 CTRL+w +
垂直分割
10 CTRL+w <(减少)
30 CTRL +w >(增加)
In case you need HORIZONTAL SPLIT resize as well:
The command is the same for all splits, just the parameter changes:
-
+
instead of<
>
Examples:
Decrease horizontal size by 10 columns
Increase horizontal size by 30 columns
or within normal mode:
Horizontal splits
10 CTRL+w -
30 CTRL+w +
Vertical splits
10 CTRL+w < (decrease)
30 CTRL+w > (increase)
我这边的另一个提示:
为了将窗口的宽度设置为 80 列,请使用
为了将其设置为最大宽度,只需省略前面的数字:
Another tip from my side:
In order to set the window's width to let's say exactly 80 columns, use
In order to set it to maximum width, just omit the preceding number:
我将这些映射到我的 .gvimrc 中,以便让我按 command-[arrow] 来移动当前窗口的高度和宽度:
对于 MacVim,您必须将它们放入您的 .gvimrc (而不是您的 .vimrc)中,因为它们否则会被系统覆盖.gvimrc
I have these mapped in my .gvimrc to let me hit command-[arrow] to move the height and width of my current window around:
For MacVim, you have to put them in your .gvimrc (and not your .vimrc) as they'll otherwise get overwritten by the system .gvimrc
同样,我在
.vimrc
中使用以下内容来让我在分割中移动,自动将我要移动到的分割扩展到其完整大小,并将所有其余部分缩小到最小高度或宽度:Along the same lines, I use the following in my
.vimrc
to let me move through the splits, automatically expanding the one I'm moving to to its full size and shrinking all the rest to their minimum height or width:这是我现在正在使用的:
This is what I am using as of now:
要更改宽度,请使用“垂直调整大小”,要更改高度,请使用“调整大小”。
我在 .vimrc 中完成了以下映射
ALT→ 将增加所选分割的宽度
ALT← 将减小所选分割的宽度< /p>
ALT↓ 将增加所选分割的高度< /p>
ALT↑ 将降低所选拆分的高度< /p>
我的 .vimrc 代码:
Vim 更快地调整分割大小
For changing width use "vertical resize" and for changing height use "resize".
I have done following mapping in my .vimrc
ALT→ will increase width of the selected split
ALT← will decrease width of the selected split
ALT↓ will increase height of the selected split
ALT↑ will decrease height of the selected split
My .vimrc code:
Vim Resize Splits more quickly
我通过在 .vimrc 中映射以下内容来使用数字来调整大小
I am using numbers to resize by mapping the following in .vimrc
我为此使用以下命令:
I am using the below commands for this: