Operation in command mode
Replacement characters:
%s/str1/str2/g
Delete all content:
%d
Do not save exit:
Q!
Save exit:
wq!
Execute shell command:
!command such as!ls-l
Insert the shell command execution result on the next line:
R!command such as R!date
Specify the line to be inserted after the shell operation:
69,72!command
69!command the 69th Line as command input
.! command to enter the line where the cursor is located
Specifies that the line is edited with the shell but not inserted:
69,72 W!command
W!command 69 lines as command input
. W!command the line where the cursor is in the input
H//Left move
J//Down Move (bottom)
K//Move up (top)
L//Move Right
CTRL + F//Move down one page
CTRL + B//Move up one page
0//move to Wardrobe
$//move to end of line
w//Jump backwards a word
G//Move to last line of file (common)
NG//Move to the first few lines of the file
GG//Move to the first line of this file.
:%s/word1/word2/g//indicates word1 all replaced with Word2
/word//Find woed characters.
Down (N)
Up (N)
X//Delete one character at cursor
DW//Delete the word
DD//delete cursor in the row
NDD//Delete the row below the line n
D1G//Delete all data from the row of the cursor to the first row.
DG//Delete all data from the line to the last row of the cursor.
YW//Copy the word
yy//Copy all data from the line where the cursor is located
nyy//the next n rows where the cursor is copied, n is the number
Y1G//Copy the cursor line to the first row of all data.
YG//Copy the cursor line to the last row of all data.
P//Paste the copied data to the following line
P//Paste the copied data to the top
J//combines the row of the cursor with the next line into a row.
U//Restore Last Action
Use of the Vi/vim editor