Using the VSP command:
For example: There are files under a folder:
The code is as follows:
vector.cc, substr.cc
1. Open any file using the VIM command: Vim vector.cc open the first file. As shown in the following illustration:
2. Press: "ESC" key + ":", and enter
The code is as follows:
: VSP substr.cc
。 (Here vsp is like the vi/vim operation, the path is free to switch.) ) as shown in the following illustration:
3. Press the "Enter" key. As shown in the following illustration:
4. To allow the mouse to switch freely between several screens.
Press: "ESC" key + ":", enter:
The code is as follows:
Set Mouse=a
。 Then, enter (enter) so that the mouse can move freely between the multiple screens. As shown in the following illustration:
Vim Multi-Window general operation:
1, open multiple Windows
command to open multiple windows The following:
Landscape cut window
: new+ window name (after saving is file name)
: split+ window name, also can be abbreviated as: sp+ window name
Portrait cutting window name
: vsplit+ window name, can also be abbreviated as follows: vsp+ window name
2, close multiple Windows
can be used: q!, also can use: Close, the last window can not be closed with closing. Using close only temporarily closes the window, its contents are still in the cache, and only q!, w!, or x can really quit.
: TABC Closes the current window
: Tabo closes all Windows
3, window switch
: ctrl+w+j/k, through the j/k can switch up and down, or: Ctrl+w plus the next key, you can also double-click the ctrl+w to switch windows in turn.
4, Window sizing
Portrait adjustment
: Ctrl+w + Portrait expansion (increase in number of rows)
: ctrl+w-Zoom down (decrease in number of rows)
: Res (ize) num For example:: Res 5, show rows adjusted to 5 lines
: Res (ize) +num adds the current window height to num rows
: Res (ize)-num reduce the current window height by num line
Landscape adjustment
: Vertical res (ize) num Specifies that the current window is a num column
: Vertical res (ize) +num adds the current window to the NUM column
: Vertical res (ize)-num reduce the current Window num column
5, rename the window
: F file
6, vi Open multiple files
VI a B C
: N jumps to the next file, you can also directly specify the file to jump, such as: N C, you can jump directly to the C file
: e# back to the file you just edited
7, file browsing
: Ex Open Directory Browser, you can browse the current directory of all files, and can choose
: Sex horizontally splits the current window and opens the Directory browser in a window
: LS Displays current buffer condition
8, VI and Shell switch
: Shell can switch to shell command line without closing VI: Exit From the shell back to VI