Replace command format
• Command Format
: [Replace-range] s/replace-pattern/replace-string/ [c,e,g,i]
• Command Description
text replace range , in general form, is [M,n] , which indicates that the text between rows of M and n will be replaced. This option can be omitted, and the text that replaces the current line is omitted. You can use wildcard characters $ and % , where the wildcard character $ means End Line Wildcard % means [1,$] , which is the entire text that is currently being edited.
Replace-pattern:
The string that will be replaced, which can be matched by using regular Expressions .
Replace-string:
Replace the Replace-pattern string .
C:
Ask before each replacement, C denotes confirm.
E:
No error message is displayed, E indicates error.
G:
does not ask for an entire line substitution, G represents global.
I
case insensitive, I represents ignore.
/ :
delimiter. Note You can use # as the delimiter, when the/no longer appears as a delimiter in the string.
Common substitution Commands
:%s/read_cb/readcallback/g
Replaces all READ_CB strings of the current text with readcallback strings
Vim Replacement Command