Larry Alkoff wrote:
Erlend Hamberg wrote:
On Friday 16 February 2007, A.J.Mechelynck wrote:
Maybe -- I've never understood how to properly use the * register under
X11. What comes from "Edit => Copy" (or Ctrl-C) in some non-Vim program
arrives in the + register in gvim, and what I yank into the + register in gvim is available for "Edit => Paste" (or Ctrl-V) in any non-Vim program --
those I can understand.

In short:
X has, in addition to the regular clipboard, a selection buffer.
When you copy/cut text, it is placed in the clipboard (register + in vim). When you select text with the mouse it's placed in the selection buffer (register * in vim) without touching the clipboard.


I've been following this discussion and trying various things
but still can't get the hang of pasting in from other X programs.

So far the only thing that works is to use the mouse to select and copy with left click which allows me to paste in vim with xterm menu -> edit -> paste. Presumably this uses the vim + register.

I understand that copies elsewhere in X load the + register in vim
and mouse select loads the * register.

What doesn't seem to work is to paste + or * register stuff into vim. Could I see some specific examples?

Larry


Using + register:

- Select text in any X program (Thunderbird, Firefox, Konqueror, ...)
- Edit => Copy

In gvim:
- to paste characterwise after the cursor:
        "+p
- To paste characterwise before the cursor:
        "+P
- To paste linewise after the cursor line:
        :put +
- To paste linewise before the cursor line:
        :.-1put +
- To paste linewise at the end:
        :$put +
- To paste linewise before the first line:
        :0put +
etc.

I don't use the * register myself, so the following is only hearsay:
Select text in any X11 program
In gvim: replace + by * everywhere to paste the selection.
<MiddleMouse> should also work, provided that the 'mouse' option includes "n" or "a".

For console Vim:
- it won't work in /dev/tty (the pure-text console) because the latter has no access to the X server hosting the clipboard and selections - it will work in an xterm, konsole or gnome-terminal if the current version of Vim was compiled with clipboard support.


Best regards,
Tony.

The following fortune sig makes me think:

Time flies like an arrow
Time bees like a bullet.

--
Time flies like an arrow
Fruit flies like a banana

Reply via email to