The Power of C

Seasoned Vim vets will tell you to stay out of Insert mode as much as possible. It's hard to master, but will make your edits more resilient to mistakes and more reusable with repeats.

To reach this goal you need to master entering and exiting Insert mode. One command that makes entering Insert mode better is the change command, which you can issue by pressing c. It accepts a motion, so you can change a word under the cursor cw, or even change up to a specific character (cfx where x is the character). The power lies in your understanding of motions.

Like d there are shortcuts: cc deletes the current line and starts Insert mode. I often C which deletes from the cursor position to the end of the line. This is great for editing copy and pasted lists.

You can use change commands with Visual mode as well. Because C deletes selections into a register, you can change a set of lines then put them somewhere else afterwards.

blog comments powered by Disqus