1 find
/xxx (? /means look down,? indicates that the look up where xxx can be a regular expression, about the formal type is not much to say. Generally case-sensitive, to be case-insensitive, you must first enter: Set ignorecase Find later, then enter N to find the next match, enter n reverse direction lookup *(#) when the cursor rests on a word, enter this command to find the next (top) word matching the word, then enter N to find the next match, the output In N reverse direction find G*(g#) This command is similar to the previous command except that it does not exactly match the word at the cursor, but rather matches all strings containing the word GD This command finds words that match the word that the cursor is in. and place the cursor in the non-comment segment of the document where the first occurrence of the word appears , this command looks for an inverse bracket that matches the cursor, including () [] {}f (f) x This command indicates that the cursor is located on the line where the first x character of the right (left) side of the cursor is found: input; continues to look for input, indicating the reverse direction of the lookup
2 Quick Move Cursor
W (e) move the cursor to the next word b move the cursor to the previous word 0 move the cursor to the beginning of the line ^ move the cursor to the line at the beginning of the character of the bank Move the cursor to the end of the bank h move the cursor to the first line of the screen m move the cursor to the middle line of the screen L move the cursor to the end line of the screen GG move the cursor to the first line of the document G move the cursor to the endof the document C-F (that is, the CTRL key is pressed together with the F key) This command is page DOWNC-b (that is, the CTRL key and the B key are pressed together, and then the command is Page up ") command is very useful, it moves the cursor to the previous mark, such as GD, * and so on to find a word, and then enter this command back to the last place to stay ' This command is quite good, it moves the cursor to the last modification line ' This command is quite powerful, it moves the cursor to the last modification point
3 Copy, delete and paste
In vi, y means copy, d means delete, p means paste where copy and delete are combined with the cursor Movement command, see a few examples to understand the YW represents the copy from the current cursor to the end of the word at the cursor the DW represents the deletion of the content from the current cursor to the end of the word at the cursor y0 table A copy of the content from the current cursor to the beginning of the cursor D0 means that the content from the current cursor to the beginning of the cursor is deleted y$ means that the copy is from the current cursor to the end of the line at the cursor d$ means that the content from the current cursor to the end of the cursor is deleted YFA represents a copy from the current cursor to the first The content of DFA represents the deletion of the contents from the current cursor to the first a character following the cursor
In particular:
YY means that the copy cursor line DD means the deletion of the cursor row d means the deletion from the current cursor to the end of the cursor line of content
Reproduced: Original: http://www.centoscn.cn/2372.html
Linux VI (VIM) Common command Summary