6

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?

1 Answer 1

9

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).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.