Hello,
Steps to reproduce the bug:
# 1 - create test file and open it with bare vim
$ echo "aaaaaa" > test
$ echo "bbbbbb" > test
$ vim -u NONE test
# 2 - copy first line 'linewise' in register a by typing V"ay
# 3 - enter insert mode at end of 2nd line by typing jA
# 4 - paste content of register a by typing <c-r><c-p>a
After these steps the content of the test file is
aaaaaa
aaaaaa
bbbbbb
instead of
aaaaaa
bbbbbbaaaaaa
When reading the documentation of i_CTRL-R, it is written that this behavior is what is expected of CTRL-R CTRL-O (while nothing indicates that it should be the same for CTRL-R CTRL-P)
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't
auto-indent. Does the same as pasting with the mouse
|<MiddleMouse>|. When the register is linewise this will
insert the text above the current line, like with `P`.
The '.' register (last inserted text) is still inserted as
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^O" and not the
text from the register.
Does not replace characters in |Replace-mode|!
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the
indent, like |[<MiddleMouse>|.
The '.' register (last inserted text) is still inserted as
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^P" and not the
text from the register.
Does not replace characters in |Replace-mode|!
Am I right and is this a bug?
If not, is there a way to fix this behavior with some hidden option or flag?
Thank you very much
``
9.1 (2024 Jan 02, compiled Sep 05 2025 19:44:46)
Operating system: Ubuntu noble
Terminal: Gnome-terminal
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
# 1 - create test file and open it with bare vim
$ echo "aaaaaa" > test
$ echo "bbbbbb" > test
$ vim -u NONE test
# 2 - copy first line 'linewise' in register a by typing V"ay
# 3 - enter insert mode at end of 2nd line by typing jA
# 4 - paste content of register a by typing <c-r><c-p>a
The problem is, after the first yank, your register is in linewise mode. If you use 0v$y
register a
would be in character mode and it works as expected.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.