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