Brisk Vim (4): Modify

Source: Internet
Author: User

I think every coder has a profound understanding that modifying this operation isCodeHow important is the world?

Modification is nothing more than deletion and insertion, but Vim combines the two very efficiently.

Let's use this brisk Vim to dance on the code.

 

Character replacement
 
R: replacement of a single character R continuous replacement ~ Change case sensitivity

It's easy. Just try again.

TIPS:4 ~ It is interesting to change the case sensitivity of four consecutive characters.

 

Word Modification
 
CW from cursor to word end CB from cursor to start of Word

It is very easy to directly use CW or CB here. Please note that it is a method of adding numbers.

In this case, both 2cw and c2w can be used with the same function.

 

Row Modification
C $ from the cursor to the end of the row C function is similar to C0 from the cursor to the beginning of the rowCCDelete the entire line from the beginning. Modify the S function. Delete the characters at the position of the cursor. Then insert

This is a bit hard to remember, mainly because you can see the effect through multiple exercises.

Among them, C $ and C functions are the same, from the cursor to the end of the line, D $ + A achieves the same effect

C0 has the same effect as D0 + I. The difference is that one input is less.

The effects of CC and s are the same. In fact, s belongs to the scope of insert. It is similar here, so let's talk about it together.

S, which deletes the characters at the cursor and inserts them again. The effect is equivalent to X + I or C + space.

 

I don't want to talk about modifying multiple lines. Just add the numbers and then combine the commands.

From the above point of view, we should be able to realize that most of the commands in Vim are used in combination.

By taking advantage of this, you can quickly find out your usage habits and efficiently modify them.

 

 

 

 

 

 

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.