6

This is best explained with an example:

Start by block selecting some text:

selected

Yank and paste it somewhere else:

after paste

Note that the existing x characters were pushed over to the side, rather than being replaced.

Desired "Replace" Behavior

desired

Is there a command that achieves the above desired result?

1 Answer 1

8

There's :h put-Visual-mode. Just select the visual block of the same dimension to make it work as one-to-one replace: 1vp

1
  • Also, looks like 1vP is repeatable, while 1vp is not.
    – KFL
    Aug 14 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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