On 04/05/11 16:40, Taylor Hedberg wrote:
Andrew Neil, Wed 2011-05-04 @ 16:35:45+0300:
Is there any way to prevent the default register from being clobbered
when using the paste command in visual mode?

By default, when you use the `p` or `P` commands in visual mode, the
selected text overwrites the default register. Is there any way that
you can instruct Vim to write that text to another register?

Thanks in advance,
Drew

--
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

It's not exactly what you asked for, but keep in mind that the "0"
register always contains the most recently yanked text. So if you're
yanking from somewhere and then pasting what you yanked over a visual
selection, then the default register will indeed be clobbered, but
register "0" will still contain what you had yanked previously.


OTOH, if you're pasting something that comes from a "delete" operation, IIUC (I didn't test) your deleted text, which was in register 1 before the paste, has been pushed over to register 2 to make room for the newly deleted text in register 1.

For details, see ":help quote_number", and remember that ":reg" will tell you the contents of all registers at any time (both times without the quotes).


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
85. Choice between paying Compuserve bill and paying for kids education
    is a no brainer -- although a bit painful for your kids.

--
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

Reply via email to