"+ and "* registers

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

"+ and "* registers

Ivan Villanueva-2
Hello,
I couldn't find in the documentation how to make the "+ register being the
same as the "* register, so that I can mark some text in an application and
copy it in vim with p

Iv�n Villanueva
Reply | Threaded
Open this post in threaded view
|

Re: "+ and "* registers

A.J.Mechelynck
----- Original Message -----
From: "Ivan Villanueva" <[hidden email]>
To: "vim mailing list" <[hidden email]>
Sent: Tuesday, July 26, 2005 3:58 PM
Subject: "+ and "* registers


> Hello,
> I couldn't find in the documentation how to make the "+ register being the
> same as the "* register, so that I can mark some text in an application
> and
> copy it in vim with p
>
> Iv�n Villanueva

How to make them the same is: use an operating system with a non-X11
graphical interface (like Windows or Classical Mac). On X11 they are
different and you have to know which is which.

By including "autoselect" in the 'clipboard' option, you can make every
visual-select become a "copy to clipboard" (which IMHO is wasteful but
YMMV). Paste using "*p or the Edit -> Paste menu. Or you may want to define
a mapping to use, let's say, F4 instead of a three-key sequence.


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: "+ and "* registers

Tim Chase-2
In reply to this post by Ivan Villanueva-2
> I couldn't find in the documentation how to make the "+
> register being the same as the "* register, so that I can mark
> some text in an application and copy it in vim with p

I'm having a little trouble understanding exactly what you want.
  If you just want to paste from the "+ register rather than the
"* register, you can use

        "*p

instead of

        "+p

unless you have altered the setting of 'clipboard' at some point.

If you just want a one-shot ability to copy them, you can use

        :let @*=@+

which will assign the contents of the "+ register to the "*
register (effecting system clipboards as well).

I recommend (as the email that just arrived from Tony suggested)
using named registers when intentionally desired, leaving vim to
jockey its own internal registers.  At one point I tried
defaulting to the 'clipboard' setting that defaulted to the
system clipboard, but turned it off shortly thereafter as I
hadn't realized just how much I make editing changes that would
otherwise effect the system clipboard.

For some pointers into the help, you might start with

        :help 'clipboard'
        :help clipboard
        :help quoteplus
        :help quotestar
        :help let-register

-tim