Vim's multi-window mode management

Source: Internet
Author: User

    1. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.