Prefixing the yank and put commands with registers works, but I personally 
prefer the following, which just sets the default register to be the system 
clipboard. From :help clipboard,

        When the "unnamed" string is included in the 'clipboard' option, the
        Unnamed register is the same as the "* register.  Thus you can yank to
        and paste the selection without prepending "* to commands.

So just put "set clipboard=unnamed" in your vimrc file, use y and p as normal, 
and watch them yank to and put from the system clipboard! Woo!

Max




> -----Original Message-----
> From: A.J.Mechelynck [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 31, 2006 7:44 PM
> To: [EMAIL PROTECTED]
> Cc: vim@vim.org
> Subject: Re: put (paste) from windows clipboard into vim
> 
> Evan H. Carmi wrote:
> > hey all,
> >
> > i am wondering how to copy through windows and than paste into vim with
> > a keyboard command.
> >
> > for example: i am running FF and i copy some text, when i go into vim I
> > don't know how to put (paste) that text without right clicking and
> > selecting paste. the
> >
> > :p
> >
> > command doesn't work and seems to be put what is in the vim clipboard (i
> > don't think clipboard is the correct term for the place where vim has
> > yanked data. what is it?)
> >
> > peace, Evan
> >
> >
> >
> In Vim, the system clipboard is known as "register plus". On non-Unix
> versions, "register star" is synonymous with it. So, just prefix your P
> (put) command with "+ (double-quote plus) or, on non-Unix systems, by "*
> (double-quote star) and voilĂ ! The clipboard contents get patsed.
> Conversely, "+y or "+d do a yank (copy) or delete (cut) to the clipboard:
> 
>     "+p               paste before cursor
>     "+P               paste after cursor
>     "+y               copy (visual area, or takes a postfix telling Vim
> "what" to copy)
>     "+d               cut (visual area, or with a postfix)
> 
>     :echo @+         show the contents of the system clipboard _without_
> pasting
> 
> etc.
> 
> And BTW, it's p (put after cursor) or P (put before cursor), _without_ a
> colon prefix; or you can youse the :pu[t] command, which takes the
> register-name after the command, and accepts a line number:
> 
>     :put +
> 
> pastes the clipboard after the current line, and
> 
>     :0put +
> 
> pastes it at the top of the file (or use ":$put +", without the quotes,
> to paste at the bottom).
> 
> And the correct name (in Vim lingo) for where Vim stores data between a
> yank and a put if you don't explicitly specify a register name, is --
> the unnamed register.
> 
> See ":help change.txt", and, in particular, ":help registers".
> 
> 
> HTH,
> Tony.

Reply via email to