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
    Commented Aug 14, 2023 at 22:49

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