Vi/vim
Command mode
Insert Mode AIO
Edit mode:
AIO is the insertion mode of Vi/vim.
Command function
A append text after the cursor
A at the end of the bank additional text
I insert text at the cursor money
I start inserting text at the bank
o Inserting rows under the cursor
O INSERT INTO the cursor
Position command
Set number sets line numbers (set Nu)
Set Nonu Cancel line number
If you want to choose to jump to the specified line. Go directly to edit mode and enter line number
Command function
H, left ARROW key to move one character
J, the direction of the next key move down one line
K, move the key up one line above the direction
L, right-click one character to the right
$ move to end of line
0 move to end of line
H Move to upper screen
M move to the center of the screen
L move to the bottom of the screen
Command mode Delete, copy, Paste command
Command function
X Delete the character at cursor location
NX removes the n characters after the cursor is located
DD Delete cursor on, ndd delete n rows
DG deletes the contents of the line to the end of the cursor
D Delete the label at the end of the line
: n1,n2d deletes a specified range of rows
yy, Y Copy as Forward
Nyy, NY Copy the current row under N rows
DD Cut when moving forward
NDD cuts n rows under the current row
P, p pasted under the current cursor row or line
Replace, Search command
Command function
R replaces the character at which the cursor is located
R replaces the character at the beginning of the cursor and presses ESC to end
U Cancel the previous action
Command function
/string searches forward for the specified string, and the search is case-insensitive: Set IC
n searches for the next occurrence of the specified string
:%s/old/new/g full text Replace specified string
: N1,n2s/old/new/g returns the specified string in the specified range
ZZ can also exit in edit mode
Architects develop--26.vi/vim related actions