Vim Multi-window operation

Source: Internet
Author: User


1. Open multiple Windows
The commands for opening several windows are the following:
Horizontal cutting window
: new+ window name (file name after saving)
: split+ window name, can also be abbreviated as: sp+ window name
Portrait cutting window Name
: vsplit+ window name, can also be abbreviated as: vsp+ window name
2. Close Multiple windows
Can be used: q!, can also be used: Close, the last window cannot be closed with close. Using close only temporarily closes the window, its contents are still in the cache, and only use q!, w!, or X to actually exit.
: TABC Close the current window
: Tabo Close All windows
3. Window switch
: ctrl+w+j/k, through j/k can switch up or down, or: ctrl+w plus up and down keys, you can also double-click the ctrl+w to switch windows in turn.
4, Window size adjustment
Longitudinal adjustment
: Ctrl+w + Vertical expansion (Increased number of rows)
: ctrl+w-Zoom Out (decrease in number of lines)
: res (ize) num For example:: Res 5, display line number adjusted to 5 rows
: Res (ize) +num adds the current window height to num rows
: Res (ize)-num reduce the current window height by num rows
Transverse adjustment
: Vertical res (ize) num Specifies that the current window is num column
: Vertical res (ize) +num add num column to current window
: Vertical res (ize)-num reduces the current window to NUM columns
5. Renaming a window
: F File
6, vi open multi-file
VI a B C
: N jumps to the next file, you can also specify the file to jump directly, such as: N C, you can jump directly to the C file
: e# back to the file you just edited
7. File browsing
: Ex Opens the Directory browser, can browse all the files in the current directory, and can choose
: Sex horizontally splits the current window and opens the Directory browser in a window
: LS Displays the current buffer condition
8, VI and Shell switch
: Shell can switch to shell command line without shutting down VI
: Exit from Shell to VI

Vim Multi-window operation

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.