Suppose I have the following text:

This is a test of the emergency broadcast system

What I want to do is delete the word "test" and replace it with four spaces:

This is a      of the emergency broadcast system

Currently what I do is:


Is there a built in way to do this, or should I look into writing a macro?


Move cursor anywhere on the word "test" and then viwr (the last one is a space). Saves at least two key strokes.

  • v start visual selection
  • iw text object "inner word" (see :help text-object, read the entire section, very useful!)
  • r replace
  • (space) with spaces
  • Ah....I didn't realize you could use the r command like that....This is precisely what I needed!! – DarthRubik Apr 17 '19 at 18:15

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.