Hello,

"Jakub Marian" <[email protected]> wrote :

> Hello,
> 
> I am sure that this is an easy question, but I wasn't lucky in 
> finding the answer. Suppose that I yanked something (using y or 
> yy) and I want to paste it over several places (without yanking 
> it into some register). But when I select some text and press 
> p or P, the selected text is then yanked instead of the text 
> before, so I have to select it and yank it again. Is there any
> way to tell Vim that I want to keep the originally yanked text
> in memory?

I have a plugin that does that, 
http://code.google.com/p/lh-vim/source/browse/misc/trunk/macros/repl-visual-no-reg-overwrite.vim

And Andy Wokula sent me a nice patch I haven't integrated yet:

"------------------------------------------------------------------------
vmap p <SID>repl<SID>restore
vmap P p
vnoremap <expr> <SID>repl    <sid>Repl()
nnoremap <expr> <SID>restore <sid>Restore()

func! <sid>Repl()
    let s:reg = [getreg("@"), getregtype("@")]
    return "p"
endfunc

func! <sid>Restore()
    call setreg("@", s:reg[0], s:reg[1])
    return ""
endfunc
"------------------------------------------------------------------------



HTH,

-- 
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

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

Reply via email to