Ⅰ. 插件描述
Adapt the window proportions after Vim is resized.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/proportionalresize'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/proportionalresize'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/proportionalresize'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/ProportionalResize
Ⅳ. 文档说明
DESCRIPTION
When Vim itself is resized, the rightmost and bottom windows receive or lose
the change in size; all other windows maintain their size as long as possible.
What you usually want is that all window heights and widths are adapted, so
that the proportions of the windows remain constant.
This plugin defines a :ProportionalResize command that wraps Ex commands
like
:set lines=40 columns=80
:simalt ~m
:Fullscreen
and scales the window sizes to the new dimensions. It also records the window
layout during brief pauses and is then able to auto-adapt after spontaneous
resizings through the mouse or window manager.
SOURCE
Inspired by the following Stack Overflow question:
http://stackoverflow.com/questions/14649698/how-to-resize-split-windows-in-vim-proportionally
USAGE
:ProportionalResize {resize-cmd}
Execute {resize-cmd} (e.g. :setlocal lines=40) and
adapt the proportions of the current window layout to
the new size. So if for example you have 3 windows
split vertically 1:1:2, and a horizontal split 4:1,
the proportions will be kept instead of the rightmost
and bottom windows getting all the space increases.
:NoProportionalResize {resize-cmd}
Execute {resize-cmd} (e.g. :setlocal lines=40) without
adapting the proportions of the current window layout.
You can wrap commands which would confuse the plugin's
algorithm (e.g. a rotate function that switches
vertical with horizontal windows), so that it won't
automatically adapt the window layout.