Tags: line number blog Strong edit delete move write inux processing
Vi/vim Basic Use Method
The VI Editor is the standard editor for all UNIX and Linux systems.
$ vim 1.txt
Find characters after search Inode highlighted, input: Nohl can cancel highlighting
: Set NU Display line number: Set Nonu suppress line number
Delete, copy, and paste
"DD" deletes the cursor in the row
"NDD" Removes the downward n-line of the cursor
"D1G" removes all data from the line to the first row of the cursor
"DG" removes all data from the last row of the cursor
"YY" the line where the cursor is copied
"Nyy" Copy the Down n column where the cursor is located
"U" restores the previous operation
Insert mode
Pressing A or I will enter the write mode, at which time the text can be entered.
Exit and save the file
Press ESC and then enter
: w (write)
: wq (input "wq", save and Exit VI)
: q! (Enter q!, do not save the mandatory exit VI)
Record several commands that vim often uses