Quick query of common vim commands

Source: Internet
Author: User


We often use the vim editor when editing text in our daily work. Although vim is powerful and almost omnipotent, it is difficult to get started when we get used to word, in addition, it is not easy to remember frequently-used commands. I will write down the frequently-used command list for you to quickly query and use. You are welcome to supplement and perfect it. perfection is a habit !!! 1. ctrl + f flip down 2. ctrl + B flip up 3. g. Locate the last line of text. 4. gg locates the first line of text 5. shift + % matching brackets 6. save ZZ and exit 7. ZQ does not save and exits 8.: set nu open row serial number 9.: set nonu close row serial number 10.: % s # ***** # g Global replacement string 11. ctrl + v column editing mode. H, select k and l on the left j and select visual block on the right. The direction keys can also be reflected. x deletes the selected content. d deletes the selected content, r + replacement character is paste example r + p12.u undo the last operation www.2cto.com 13. shift + d Delete to the end of the row 14.d$ Delete to the end of the row 14. d ^ Delete to the beginning of the line 14.D delete all content after the cursor 14. :., $ d colon + one point + one comma + one $ + one d and then press enter to delete all content below the current row 14.: 1, $ d colon + number 1 + one comma + one $ + one d then press enter to delete all rows below 1st 14.: 2, $ d colon + number 2 + one comma + one $ + one d then press enter to delete all rows below 2nd 14. /kernel \ c ignore the case to find the kernel string, \ c is to ignore the case to find 15.yy copy the row where the cursor is located 16. small p paste the next row of the current row 17. big P paste the previous line of the current row by superdebug

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.