Delete whitout altering clipboard

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete whitout altering clipboard

Fabien Meghazi
Hi all,

How can I delete a line or a bunch of selected line without loosing
the yanked text in the clipboard ?

--
Fabien Meghazi
http://www.amigrave.com
Reply | Threaded
Open this post in threaded view
|

Re: Delete whitout altering clipboard

Marian Csontos
Hi,

"_dd

_ is blackhole register

-- Marian

On Thu, 30 Jun 2005 11:46:46 +0200, Fabien Meghazi <[hidden email]>  
wrote:

> Hi all,
>
> How can I delete a line or a bunch of selected line without loosing
> the yanked text in the clipboard ?
>



--
Mgr. Mari?n Csontos
program?tor POS
AXA, a.s.
Radni?n? n?mestie 4
821 05 Bratislava
tel. +421 2 4829 4218
mailto:[hidden email]
www.axa.sk
 


________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: Delete whitout altering clipboard

Altukhou Yury
In reply to this post by Fabien Meghazi
Hello Fabien,

Thursday, June 30, 2005, 12:46:46 PM, you wrote:

FM> Hi all,

FM> How can I delete a line or a bunch of selected line without loosing
FM> the yanked text in the clipboard ?
Use black hole rgister:
"_d

see
:h registers



--
Best regards,
 Wind                            mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Delete whitout altering clipboard

Cory T. Echols
In reply to this post by Fabien Meghazi
On 06/30, Fabien Meghazi wrote:
> How can I delete a line or a bunch of selected line without loosing
> the yanked text in the clipboard ?

I assume you mean the unnamed register (:he quote_quote).  This is where
all yanks and deletes go by default.  Nothing gets put in the system
clipboard unless you specifically send it there by using the * register
in your command.  (at least in my configuration.)

If you prefix the actual delete command with the blackhole register
(using a command like "_d), the current unnamed register contents won't be
disturbed.  (see :help quote_).

Alternately, the numbered registers hold the 10 most recently yanked or
deleted things.  This means if you yank something new, what was
previously in the unnamed register should now be in register 1.
Register 0 seems to be a synonym for the unnamed register.  The one
caveat is that the numbered registers don't store some "small" yanks or
deletes.  (see :help quote_number).

As another alternative, you could install David Fishburn's YankRing
plugin, which automatically gives you a history of all your yanks and
deletes, and provides commands for manipulating that history which are
more convenient that mucking around with numbered registers.  (I have it
installed, but don't use it heavily.)  Its url is

http://vim.sourceforge.net/scripts/script.php?script_id=1234

--
Cory T. Echols
Reply | Threaded
Open this post in threaded view
|

Re: Delete whitout altering clipboard

Fabien Meghazi
In reply to this post by Fabien Meghazi
> "_d

Thanks all, this is exactly what I was searching for.
I googled before asking and saw the _ register mentionned but I didn't
knew that we had to put a quote before