Reputation: 336
I got used to indent my code in such way:
asd sthng
asd someText sthng
I would like to paste something in the space in the first line. I would like to keep indention also.
Result of pasting:
asd pstdText sthng
asd someText sthng
Is there a way in VIM to paste a text in a way how replace mode (R
) works?
Upvotes: 6
Views: 1363
Reputation: 172510
You can enter replace mode with R
and then insert the contents of the register via <C-R>"
.
Alternatively, if you select the amount of text that corresponds to the to-be-pasted text (or there's a motion that covers such), you can use my UnconditionalPaste plugin to replace the selection with the register (without losing the register contents).
Upvotes: 9