I use Ctrl-R to paste in vim when I am in insert mode, but this , more often than, not messes up the inentation and I have to indent it manually or use =. All this makes Ctrl-R same as going to normal mode and use ]p if not less efficient. Any way to paste while in insert mode without messing up indentation ?

1 Answer 1


From :help i_CTRL-R_CTRL-P:

CTRL-R CTRL-P {0-9a-z"%#*+/:.-=}            *i_CTRL-R_CTRL-P*
    Insert the contents of a register literally and fix the
    indent, like |[<MiddleMouse>|.
    Does not replace characters!
    The '.' register (last inserted text) is still inserted as
  • The way vim fixes indentation is often not so good.
    – eyal karni
    Commented Feb 15, 2023 at 19:15

Your Answer

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