[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: Paste + Replace?
From:       Benji Fisher <fisherbb () BC ! edu>
Date:       2000-10-30 20:14:53
[Download RAW message or body]

     I remember:  that is Bram's improvement of my idea!  It is also
part of the vimrc_example.vim file that comes with vim 5.7 (and maybe
one or two versions before that).  To use it, yank "foo" and move to
"bar" as before, then select "bar" (for example, ve) and type  p  (for
"put") while in Visual mode.

     You can also use the 0 register, which gets a copy of "foo".  After
yanking and moving, as before, do  ce<C-R>0 .

:help registers

Also see

:help text-objects

for easy ways to select a word.

HTH					--Benji Fisher

Mark.Thomas@SWFWMD.STATE.FL.US wrote:
> 
> Don't remember who did this but it sure works great.
> 
> vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
> 
> "Ondrejko, David" <david.ondrejko@safelite.com>
> 10/30/2000 12:26 PM
> 
> 
>         To:     "'vim@vim.org'" <vim@vim.org>
>         cc:
>         Subject:        Paste + Replace?
> 
> Let's say that I yank the word "foo".  I can go down to the "b" in "bar",
> hit p and get "bfooar".  Fine so far.
> 
> Is there anything I can hit which will *replace* instead of inserting?  In
> other words, if I yank "foo", go to the "b" in "bar," is there something
> which will let me replace "bar" with "foo"?  (I can figure out how to
> delete and then insert, of course, I'm looking for a shortcut; does one
> exist?)
> 
> TIA,
> Davyd

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic