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