There are three modes of VIM
Command mode, default into command mode;
Edit mode, a I o enter the editing mode, you can edit the text content; Esc tangent back to command mode
Expansion mode,: Enter the expansion mode, you can save the exit and other operations, ESC cut back to the command mode
Key operations commonly used under VIM
DD Two d means to delete the contents of the line where the cursor is located
U undo the last step operation
CTRL + R Next, and U just the opposite, U is the last step ctrl+r is next
NDD deletes multiple rows, n is a number, and deletes the contents of n rows containing the current row.
YY the copy cursor is in the row
Nyy the following n-line contents of the row where the cursor is copied, including the cursor
P lowercase p Paste paste to the next line in the current row
P Capital P Paste to the previous row of the current line
YYNP Paste the contents of the previous copy n rows, which is two merged commands, yy is copy, then perform NP
DDP cut means that it is also a merge command that deletes the contents of the current line and pastes it somewhere
$ quick Move cursor to line end, Command mode
0 Number 0 quickly move the cursor to the beginning of the line, in command mode
GG jumps to the very first position of the entire file
G jumps to the top of the last line of the entire file
NG jumps to the first line of the file n is a number
H jumps to the top of the screen, at the top of the screen, not at the top of the file
M jumps to the middle of the screen, which is the middle of the screen
L jump to the bottom of the screen, the bottom of the screen
Set NU Display line number
Add: Jump to the beginning of the command is CTRL + A, jump to the end of the command line is ctrl+e, this is not vim, is the command under the operating interface
Linux Learning-Vim editor