- Multi-window open in vim
VIM, the default multi-window open, is the horizontal split window.
After entering the VIM editor, you can create a new child window with the new command
: New "Create an unnamed window
: New name "Create a file named name"
After entering vim, the splite can also be used to split the horizontal window.
: Split name opens the name file in its current location move the original file down
: SP name "is the splite abbreviation for the split function
After entering vim, the window can also be split vertically by vsplit.
: Vsplit name " opens the name file at its current location move the original file to the right
: vs Name " is the vsplite abbreviation for the same as the Vsplit function
2. Multi-window switching in vim
Multi-window switching in Vim can be achieved by ctrl+w the combination of key combinations and directional selection keys.
Horizontally split windows can be toggled between upper and lower windows via ctrl+w+j/k or ctrl+w+ (UP)/(down)
Vertically split windows can be toggled between upper and lower windows via ctrl+w+h/l or ctrl+w+ (left)/(right)
Press Ctrl+w twice in a row to enable switching between multiple windows
3. Multi-window adjustment in vim
Window adjustments can be divided into absolute and incremental adjustments
The absolute value is adjusted as follows:
: Resize num "Adjusts the height of the window to num rows
: Res num "resize abbreviation mode with resize to achieve the same function
: Vertical Resize num "Adjusts the width of the window to num columns
:verticalres num "Verticalresize abbreviated mode with verticalresize for the same function
The incremental adjustments are as follows:
: Resize+num "Adds the height of the window to num rows
: Resize-num "reduces the height of the window to num rows
: Vertical Resize+num "adds the width of the window to num column
: Vertical Resize-num "reduces the width of the window by NUM column
The same function can be achieved by resize shorthand to Res.
Close of multiple windows in 4.Vim
The close of multiple windows in Vim is basically similar to the closing of a single window
: Q "exit the current window
: QA "Exits all windows
Reference Blog: http://blog.csdn.net/devil_2009/article/details/7006113
Vim's multi-window mode management