Enter edit mode:
Keys |
Role |
I |
Insert in current word match either |
L |
Insert at the beginning of the line where the cursor is located |
A |
Insert in current word specifier |
A |
Inserts at the end of the line where the cursor is located |
O |
Inserts a new row on the next line in the current row |
O |
Insert a new row on the previous line in the current row |
Vim Command mode:
Keys |
Role |
/word |
Look for a string after the cursor word, press N to go back to search |
? word |
Find a string before the cursor word, press N to continue searching |
: n1,n2s/word1/word2/g |
Find word1 before N1-N2 line and replace with Word2, and no G replaces only the first word1 of each row |
: 1, $s/word1/word2/g |
Replace all word1 in the document with Word2, and no G replaces only the first word1 of each row |
: W |
Save text |
: Q |
Exit vim |
: w! |
Force save, under root user, even if the text is read-only can be saved |
: q! |
Force exit, all changes are not valid |
: Wq |
Save and exit |
: Set Nu |
Show line Numbers |
: Set Nonu |
Do not display line numbers |
This article is from the "Gary Blog" blog, please be sure to keep this source http://taoxie.blog.51cto.com/10245493/1980049
Linux into Vim's edit mode and command mode Operation command