简体   繁体   English

Vim Split和VSplit行为

[英]Vim Split and VSplit behaviour

I love using splits, right now i have a dual monitor setup with different sized screens, i typicality like to have a vertical split on the monitor division which is simple enough. 我喜欢使用拆分,现在我有一个具有不同尺寸屏幕的双显示器设置,我通常喜欢在显示器分区上进行垂直拆分,这很简单。 The problem is when ever i add another vertical split it resizes all vsplits to be the same witdth, as if i "Cw =" then re-sized the horz splits. 问题是,每当我添加另一个垂直拆分时,它都会将所有vsplits的大小调整为相同的大小,好像我“ Cw =”然后重新调整horz拆分的大小一样。 This same behaviour occurs with horz splits. horz拆分也会发生相同的行为。 This makes me need to resize my vertical splits every time i add a new one... My question is if it is possible to make the split behaviour bisect the current split only? 这使我每次添加新拆分时都需要调整垂直拆分的大小...我的问题是,是否有可能使拆分行为仅将当前拆分一分为二?

Use the equalalways option for controlling this behavior: 使用equalalways选项来控制此行为:

:set noequalalways

This will cause vim to size each new split relative the current split : giving it half the size of the current split, instead of resizing all the splits to have the same height. 这将使vim 相对于当前拆分调整每个新拆分的大小:为其提供当前拆分大小的一半,而不是将所有拆分的大小调整为相同的高度。

Note that this is also used for horizontal splits, so if you set this option, you'll get the same behavior when splitting horizontally with eg :vsp . 请注意,这也用于水平分割,因此,如果设置此选项,则使用:vsp进行水平分割时,您将获得相同的行为。

Finally, you can also specify a specific size for the next split, by preceding the split command with a value, like: :17sp , which will allow the new split 17 lines. 最后,您还可以通过在split命令之前添加一个值来指定下一个拆分的特定大小:17sp ,它将允许新的拆分17行。 This isn't as useful as noequalalways because of splits opened other ways, eg when using :help . 由于拆分以其他方式(例如,在使用:help时)打开,因此此功能不noequalalways

See :help 'equalalways' and :help split for more information. 有关更多信息,请参见:help 'equalalways':help split

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM