[Practical.vim (2012.9)]. DREW.NEIL.TIP04 Study Summary

Source: Internet
Author: User
Find and Replace by Hand


In the text above, we are going to change the content to Word copy
Maybe we can use the following command.

:%s/content/copy/g

The above command changes all the content words in the text to copy, but we do not want the content in the second line to be replaced.
We can execute the following command

Search content We can use

/content

You can also put the cursor on the content Word, and then press * , VIM will automatically search for the word where the cursor is located.
cwcommand to delete the current Word and enter insert mode, we type the word copyto be replaced, press ESC to exit Insert mode, and enter into normal mode.
By TIP4, we used to n move the cursor to the next matching position in the last search, using the . last change operation repeated. If you encounter a word that you do not intend to replace, skip it . and use it once n .

[Practical.vim (2012.9)]. DREW.NEIL.TIP04 Study Summary

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.