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.