I will use ctrl-r
quite frequently in insert mode to insert contents of a register, for example, "
, %
, or any of the [a-z] registers. I've also come across the following in the help:
tag char action in Insert mode
-----------------------------------------------------------------------
i_CTRL-R CTRL-R {register} insert the contents of a register
i_CTRL-R_CTRL-R CTRL-R CTRL-R {register} insert the contents of a register literally
i_CTRL-R_CTRL-O CTRL-R CTRL- O {register} insert the contents of a register literally and don't auto-indent
i_CTRL-R_CTRL-P CTRL-R CTRL-P {register} insert the contents of a register literally and fix indent.
What exactly is the difference between these? For example, for the insert register literally
I was thinking that it would convert something like a newline into a control-sequence, so the text:
Hello
There
Would be converted to something like:
Hello^JThere
But that doesn't seem to be the case. Could someone explain the differences between the four ctrl-r
options perhaps using an example for how the four would actually produce a different output when pasted into vim?
:help i_CTRL-R_CTRL-R
explains the difference and includes an example.ab^Hc
. I was more curious about some more extensive examples -- lists, dicts, strings with actual newlines and tabs in it, etc., etc.