Vim Replacement Command

Source: Internet
Author: User

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

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.