Common Vim tips (2015-7-15)

Source: Internet
Author: User
: g/^$/d Delete blank line:%d delete all rows: g/^[0-9]*$/d Delete Only the number of rows if you want to change the file name of the file that is currently being edited, the workaround is to first use: F to Buffer name, and then delete the original file:: F New_file_name:!del # (# will be automatically replaced by VIM to the previous filename) here will be a command-line window, if you do not want to see it, the second command changed to:!start/b del # VIM format code: GG=G formatted full-text directive = = Formatting the current line 8= and formatting the current cursor next 8 lines vie Select Code in w mode and press = To format comments directly Java code:%s/^/\/\//g ? undo operation on U ^r hex edit windows:!xxd Replace all Chinese characters with English characters normal mode under map <c-s > on Lines 10 to 18 Note: 10,18s#^#//#g给10到18行反注释: 10,18s#^//# #g

Common Vim tips (2015-7-15)

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.