Linux VI (VIM) Common command Summary

Source: Internet
Author: User

1 find
/xxx (?  XXX) means searching the entire document for a string matching xxx,/means looking down,? It means looking up where xxx can be a regular expression, not much about regular typing. Generally case-sensitive, if you want to be case-insensitive, you have to enter:set ignorecase to find the next match, enter N to find *(#) when the cursor hovers over a word, enter this command to find the next (top) word matching the word, then enter N to find the next match, and enter N to find g*(g#) This command is similar to the previous command except that it does not exactly match the word at the cursor, Instead, match all the strings that contain the word gd this command to find the word that matches the word in the cursor, and rest the cursor in the non-comment segment of the document where the word first 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 of the search, looking for the right (left) side of the first X character found after: enter; 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 $             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 of the screen GG move the cursor            to the first line of the document G             move the cursor to the end of the document C           -F (that is, the CTRL key and the F key are pressed together) This command is page downc-B (that is, the CTRL key is pressed with the B key, then the command is page up ") This command isvery useful, it moves the cursor to the previous mark, such as GD, * and so on to find a word, and then enter this command Then go back to the last place you stayed ' 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.