Vim skills (2) search and replace

Source: Internet
Author: User

Today I will share with you how to find and replace vim.

 

For example, there is an article. Chinese and English are not limited. If you want to find the text or words in the notepad of the win system, press Ctrl + F to query them.

In vim, you can directly/query words. You can use this command to highlight all the remaining words in the document.

You only need to press n to perform the next

Press n to add

 

This is the search method.

--------------------------------------------

What should I do if I want to replace it after searching?

It is actually very simple.

For example, I want to convert "hello" in the document to "good ".

First, we first position the cursor to the first hello location, then press * to highlight all remaining Hello words, and then press CW to automatically Delete the first hello. Enter the content you want to replace. For example, enter "good" here and then "ESC" to exit. Then we press n to the next position and then just press.

 

Vim skills (2) search and replace

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.