On Feb 24, 9:45 am, Ted Pavlic <[email protected]> wrote:
> I've looked in:
>
> :help v_p
> :help registers
>
> and I cannot find this behavior documented, and so I wonder if it's a bug.
>
It looks like it is documented...sort of. From :help v_p:
"(Implementation detail:
it actually works by first putting the register after the selection
and then
deleting the selection.)"
I take this to mean it will first do an <esc>`<P and then do a `<d`>
or something similar.
Doing these commands will in fact override the unnamed register,
though the documentation could certainly be made more clear.
> If I visually select a block and hit "p" to paste from the unnamed
> buffer, the block I'm overwriting gets put into the unnamed buffer.
> There are two strange consequences of this:
>
> 1. If I need to make several replacements down my file, I have to do a
> new copy between each replacement (or use a new buffer).
Better idea: instead of just p, hit "0p to always paste from the yank
register. Or even use a mapping like :vnoremap p "0p
>
> 2. If I select the same block over and over again, hitting "p" will
> toggle the block back and forth from its old state to its new state.
>
That's actually kind of cool...and lets you move blocks around easier.
> Is this the desired behavior? If so, shouldn't it be documented?
>
> Also, is there any way to disable this behavior? I'm happier knowing
> that only "d", "c", "s", 'x", and "y" put things into the unnamed buffer.
>
:vnoremap p "_d"0P or similar ought to do it.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---