The Magical vim~ turn IBM

Source: Internet
Author: User

The% address range symbol, which represents all lines in the file, is equivalent to the address range 1,$
. Matches any single-character (except for newline characters), such as Y.S can match yas Y.s or Y S, and so on.
* Matches 0 or more occurrences of the previous character, such as y*s can match Yys Yyyyys or S, and so on.
$ matches the end of the line.
& Represents a string that appears in pattern matching, such as S/abc/&def, which replaces the current line's ABC with ABCDEF.
[] matches characters appearing in [], such as [ABC] match character, A, b or C, [a-za-z] matches all English characters.
The content that appears between \ (\) \ (and \) can be replaced by \num.
\1\2\3 overrides the content that appears between \ (and \).
\u capitalize the first letter of the subsequent string.
\{num} matches the num occurrences of the previous character.

⑽:$ to the last line of the file

⑾:s/.*/&^m-----------------------------------------------
Inserts a line "-" character at the last line of the file.

⑿:g/female/.m$
Move all female employee records to the end of the file

[. Execute command M cut, CO copy d delete]

Delete the line containing the character file: G/FILE/.D

The G is placed at the end of the command to replace each occurrence of the search string, without g, which means that only the search

Replace the first occurrence of the string, and G at the beginning of the command to replace all rows in the body that contain the search string.

The Magical vim~ turn IBM

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.