copying from vi to clipboard does not over writes clip board buffer

J dreadpiratejeff at gmail.com
Wed Feb 16 15:48:16 UTC 2011


On Wed, Feb 16, 2011 at 10:21, Colin Law <clanlaw at googlemail.com> wrote:
> On 16 February 2011 13:55, J <dreadpiratejeff at gmail.com> wrote:
>> Something I've found very useful and so far has worked for me on
>> various Linux distros and various terminals (aterm, Gnome Terminal,
>> xterm, Terminator, etc):
>>
>> In the terminal, regardless of whether its running vi, emacs, or just
>> sitting in the shell, highlight the text you want with the mouse
>> (right click and hold and drag fro one end of the selection to the
>> other, then release right button.
>>
>> In the target, where you want the text to appear, middle click, OR
>> click both right and left buttons simultaneously at the position you
>> want to paste the text.
>>
>> That works pretty much ever time, universally, without having to
>> wonder if the text I copied is now in this buffer or that buffer or
>> wherever, and as long as you don't click anywhere else (do any other
>> click actions) you can middle click and paste that selected text as
>> many times as you want.
>
> Wow, I did not know that (though I find I have to mark with the left
> button, not the right).  It does not only work to and from the
> terminal, it works with all apps that I have tried so far.  Many
> thanks for that gem of knowledge.  In particular it gets round a
> problem I have with jEdit that copy out of jEdit will not paste into a
> terminal for some reason (into gedit and other apps is all right, it
> is just the terminal that it will not paste into, similarly I can copy
> from gedit into the terminal, it is just jEdit to the terminal that is
> the problem, no more a problem though with the new magic method).

No problem... I discovered that ages and ages ago and I hardly ever
use the clipboard for anything because of it.  I've never seen that
documented anywhere, in nearly 2 decades of using Linux in various
ways, so I don't even know if that is intentional behaviour or just a
happy accident of design.

The only trick though is that you lose the text if you left click
anywhere else... which changes focus from the original window that you
highlighted text in.

And yes, that should  have been LEFT clicks, not RIGHT clicks,
(unless, of course, your mouse is mapped for left handed usage, which,
IIRC, reverses the button order).  I can't always tell right from left
:)




More information about the ubuntu-users mailing list