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 ?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy