Saturday, March 4, 2023

Re: Can I copy/yank into and out of vim?

On Sat, Mar 4, 2023 at 4:24 AM Angel M Alganza <ama@ugr.es> wrote:
>
> On 2023-03-04 03:48, Tony Mechelynck wrote:
>
> > The reason for this dfference in behaviour is that xterm doesn't use
> > the X11 clipboard (register + in Vim) but only the X11 selection
> > (register * in Vim). In almost every other GUI, including gvim, you
> > can use Edit→Cut, Edit→Copy and Edit→Paste to pass text from one
> > program to another via the clipboard, but in xterm you need to have
> > some text selected (and, in Vim, written to "*) then the middle mouse
> > button pastes into xterm; conversely, IIUC anything selected in xterm
> > will appear in Vim's * register and can be pasted with "*p or with
> > <MiddleMouse>.
>
> Thank you, Tony. I don't know how many times I've read a similar
> explanation over the almost 30 years I've been using Unix-like OS, but
> for sure I don't have enough fingers to count them. Still, the only
> thing I can understand is that there are different "clipboards" and that
> Shift+Insert works sometimes but not always. Usually by trying several
> times I end up getting "pasted" what I expect, and at times I need to
> reach for a mouse (I hace mice unless they have fur and teeth) middle
> button which also works some times. LOL
>
> I don't seem to find an explanation of the different between what you
> describe as "in xterm you need to have some text selected" and whatever
> the alternative (not having some text selected?) might be. :-)
>
> Cheers,
> Ángel

After doing Edit→Cut in some program (including gvim, where "+d is
also available), the text you cut is no longer selected, but it is in
the clipboard. Using Edit→Paste elsewhere (in the same program or
another one) will paste it, but not into xterm, which doesn't use the
clipboard but only the selection. In xterm there are no Edit→Copy,
Edit→Cut or Edit→Paste menus, nor do Ctrl-C, Ctrl-X or Ctrl-V (or some
other keyboard mechanism such as Vim's "+y "+d "+p "+P sequences)
exist in xterm.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXs3jx-YmZN_KcomFme72Mk1ymMzT02Y5vQih5jZ%2Brin-Q%40mail.gmail.com.

No comments: