I think that the best way to do this is just with registers.  So what
you would do is:
v<highlight region>"ay
v<highlight region>"ap

what this does is use the a register to yank to/put from.

For more info see :help y and :help p

On 3/10/07, Peng Yu <[EMAIL PROTECTED]> wrote:
Hi,

Suppose I want to replace "string1" with "string2" in a file from vim.

1. Highlight "string1" (in visual mode) and then type "y".
2. Highlight "string2" (in visual mode) and then type "p".

However, the problem with the above procedure is that "string2",
instead of "string1", is in buffer. That is if I highlight "string3"
and then type "p", "string3" will be replaced with "string2" instead
of "string1".

I'm wondering if there is any way to avoid change the content in the buffer?

Thanks,
Peng



--
-fREW

Reply via email to