G'day everyone,

I've been a hard-core vim user for over a decade and I've never found an 
answer for this. It's about time I post it to a forum. :-)

I want a way to replace text with the contents of a register.

For example, let's say I have the sentence 'The banana is green; I like 
green bananas'. If I've yanked the word 'yellow' from somewhere else 
into the default register, I want to be able to move the cursor to each 
word 'green' in the sentence below, and change it to 'yellow'. (Yes, 
normally I'd just do a one-line search-and-replace; this example is just 
an illustration.) If I use cw, 'green' clobbers 'yellow' in the 
register, and I don't know of a way to paste in insert mode anyhow.

Why would I want to do this? Sometimes it's just convenient, and it 
frustrates me that I can do it in most primitive editors and not vim. In 
Notepad, for example, if you select text and then invoke the paste 
operation, it'll replace the selected text with whatever is in the 
clipboard. If for any reason I have to use one of those editors (which I 
thankfully haven't for some time), this feature is a saving grace.

Can this be done in vim?

Thanks,
Michael Scheper.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to