Tuesday, July 17, 2012

Pasting linewise registers with i_CTRL-R_CTRL-O

The help for i_CTRL-R_CTRL-O does not indicate anything special about whether the register pasted is linewise or characterwise, but I see the following behavior which is confusing me (and renders i_CTRL-R_CTRL-O nearly completely useless for me):

Test 1:
Starting text:
abc def
ghi jkl

Cursor in insert mode after "ghi"

Register 0 contains "abc def" yanked characterwise with 0y$

i_CTRL-R_CTRL-O 0 changes the last line to "ghiabc def jkl"

Test 2:
Same starting text.
Same cursor position.
Register 0 contains "abc def" yanked linewise with yy

i_CTRL-R_CTRL-O 0 does not change last line at all, instead it pastes a new "abc def" line above the cursor line. Cursor position has moved to the beginning of the last line.

Is this how the feature is supposed to work? I want to be able to paste a linewise selection (actually a deletion) within a pair of parentheses, for example, so I figured the insert-mode methods of getting the text would work.

Interestingly, just plain i_CTRL-R does as I would expect, but since it messes up the indent, I don't like it.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: