0

My Problem

Going from:

enter image description here

To:

enter image description here

I'm doing some editing (interactive rebase on a git repo, but the problem is generally relevant).

  1. The cursor is on a word (pick), and I would like to delete it , regardless of the cursor position in it
  2. Then, take the cursor back to the position of its first characterand
  3. Immediately insert the new word (r)

My Question

Is there a shortcut to the common sequence of: Delete word, go to its beginning, move to insert mode?

5

Yes.

ciw

The mnemonic is change inside word.

The c command is like the d command, except that it immediately goes to insert mode afterwards. So this is really like using diwi. Using iw instead of w is to make sure the whole word your cursor is on gets deleted, not just the rest of the word from where your cursor is.

| improve this answer | |
  • Thanks! <More characters> – Adam Matan Jun 19 '19 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.