This article mainly introduces the common editing commands of vim:
Character editing:
x: Delete the character at which the cursor is located;
#x: Delete the # characters at the beginning of the cursor;
Replace command:
R: Replaces the character at which the cursor is located;
Rchar;
For example: Replace the L in the list with the uppercase L, assuming the cursor is now in the list L, you need to press the R key, press "Shift+l" to complete the replacement;
Delete command: The deleted content does not disappear completely and is stored in the corresponding buffer area.
D: Can be combined with the cursor jump character, to achieve range deletion;
Example: d$, d^, DW, DE, DB (also supported #command)
DD: Delete the row where the cursor is located;
#dd: Delete the total # line at the beginning of the cursor (including the row on which it is located);
Copy command:
y: The working behavior is similar to the D command;
Paste command:
P: the content within the buffer (that is, the copied content) is pasted at the bottom of the line where the current cursor is located, if it is an entire line , otherwise, the back side of the current cursor;
P: The content within the buffer (that is, the copied content) is pasted at the top of the line where the current cursor is located if it is an entire line , otherwise, the front side of the current cursor is pasted;
Change the command:
C: Can be converted from edit mode to input mode, and implement the deletion function, similar to the D command;
Undo command:
u: Undo the previous operation;
ctrl+r: Revocation of previous revocation;
Repeat the previous edit operation:. No.
Visualization mode: Similar to the area Check feature in Windows text
Press the v key: Select by character;
Press the V key: Select by row;
Note: Can be used with cursor jump to achieve range selection;
Report:
Vim's multi-file feature:
Multiple files:
Vim FILE1 FILE2 ....
To switch between files:
: Next Next file
: Prev Previous file
: Last File
: First file
Exit All Files:
: Wqall Save all files and exit
: Wall
: Qall
Multiple windows:
- o: Horizontal split window
- o: Vertical Split window
Switch between the Windows: First press the CTRL+W key and then release, then press the corresponding direction key;
Note: Individual files can also be viewed in separate screens
ctrl+w s: horizontal split window;
ctrl+w v: vertical split window;
Vim Editor Operation ②