Thursday, November 8, 2012

Re: Clipboard copy and paste

On Thursday, November 8, 2012 10:51:56 AM UTC-6, Ed Kostas wrote:
> I am trying to copy and paste things from vim into other applications. In general, there are two ways of pasting the clipboard contents. I can use Ctrl-V (Ctrl-Y in Emacs) or the central button of the mouse. The following solution works fine with the central button/wheel:
>
>
>
> v move y
>
>
>
> or v move "*y
>
>
>
> In another application, one can press the central button, and voilà. For instance, in Emacs, I can press the central button, and I get the contents of the clipboard saved with "*y. However, I don't like this solution very much, since the central button is wheel in many mouses, and people can turn the wheel inadvertently. I prefer to press Ctrl-y in Emacs, or Ctrl-V in other applications (for instance, in gedit, or in this group). The problem is that Ctrl-V and Ctrl-Y do not work with the Vim "*y save register.
>
>
>
> I checked the compilation of the vim distribution I am using. Thus:
>
>
>
>
>
> ~/vim/tutor$ vim --version | grep clipboard
>
> +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
>
> +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
>
> ~/vim/tutor$
>
>
>
>
>
> As you can see, I have +clipboard and +xterm_clipboard. Is there a way to send the contents of Vim Clipboard to Ctrl-V paste, instead of central wheel paste?

CTRL-V is useful, you probably don't want to remap it. Although, if you do, CTRL-Q is a synonym. See :help CTRL-V, i_CTRL-V, c_CTRL-V.

Pasting from the same clipboard used by the center wheel in Vim is done by selecting the * register for paste, like this:

"*p

Or in insert mode:

<C-R>*

These are examples, as there are many paste commands in Vim that do something slightly different. The key is to select the * register with "* first.

Note, it IS possible to remap CTRL-V to something like "*p, but not really recommended.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: