Enter edit mode
Edit mode, which is the mode that we can modify the document, configure
I insert in the current word match either
I (uppercase) is inserted at the beginning of the line where the cursor is
A inserts after the current character
A (uppercase) is inserted at the end of the line.
o Insert another line below the current line
O (uppercase) Inserts an additional line above the current line
·
·
·
·
·
VIM Command mode
Find:/Add the characters you want to find:
·
Replace: (: 1,21s/yang/huang/g) means to replace Yang with Huang in 1-21 lines (no G will replace only the first one in a row)
·
Without the G-look.
·
(: 1, $s/yang/huang/g) means 1-The last line replaces Yang with Huang
If the word you want to replace character has a slash that conflicts with a slash in the original format, we can add a backslash before the slash to replace the word character.
If we replace/bin/bash with Yang, we can write it (: 1, $s/\/bin\/bash/yang/g) br/>! [] (http://i2.51cto.com/images/blog/201804/13/c711dc097779eaebe206e85562521df8.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=)
`
You can also change the slash in the format to # or @.
`
: Wq Save Exit
: wq! Force Save exit
: q! Force not save exit
: Set NU Displays the number of rows
: Set Nonu does not display line numbers
: Nohl Suppress search results
: x (uppercase) is similar to: Wq, but is used when you do not change the contents of the file: Wq exit changes the Mtime, and: X (uppercase) does not
·
·
·
·
·
·
Vim Practice
Into the edit mode VIM Command mode VIM practice