26

I don't really understand the linux clipboard/s scheme. Instead of understanding it, is there a way to simplify it into one, unified clipboard? You know, so I could copy in any app and paste in any other?

The current issue that's bugging me is IntelliJ's "copy path" action seems to copy the path of the current file, but I can only paste it back into IntelliJ itself - if I try to paste it into a terminal, the content simply isn't in the clipboard.

6
  • Never used that IDE, but I don't have any issues with the Linux clipboard. Are there other sch situations?
    – tshepang
    May 22, 2011 at 13:42
  • 1
    @Tshepang - one example is in gvim, if I select a text, do edit-->copy, then select another piece of text, then I effectively have two different pieces of text to paste. Middle click will paste the last text I selected, while edit->paste will paste the text I edit->copied.
    – ripper234
    May 22, 2011 at 14:19
  • There is concept of clipboard in the X Window system. Given that most of the time you work in X, this is only a matter of configuring/patching programs not using X clipboard to use it. For example, X-window enabled GNU Emacs don't copy to X clipboard by default, but can be easily configured to do so.
    – alex
    May 22, 2011 at 15:01
  • @alex Not exactly true, there are multiple concepts of clipboard in the X Window System. May 22, 2011 at 18:30
  • 1
    @ripper234: That's because Vim by default copies to its internal buffer. If you want to copy to the system clipboard, use the + special buffer, to copy "+y and to paste "+p in the Command Mode. The * buffer is the middle click buffer, and there are many regular buffers which can only be used by Vim which can be accessed by prefixing the copy/paste with "a to "b (e.g. "aY)
    – Lie Ryan
    May 22, 2011 at 18:38

3 Answers 3

14

There are several clipboard managers such as parcellite, klipper, glipper, glippy, anamnesis, pastie and others. These generally allow you to manage your clipboard by presenting a history.

Some of them allow you to treat the primary and secondary clipboards as one (parcellite and klipper definitely do).

Anamnesis allows you to plow through your history with a search tool.

3
  • 4
    I just installed Parcellite following your suggestion and it works wonderingly well. It's simply and get's the job done. Thx for the suggestion!
    – jeroen
    Dec 7, 2012 at 9:29
  • Anamnesis fits the job well. Very small codebase and easy to read, to boot. Feb 19, 2013 at 2:54
  • 1
    Those of us with heavy use of ssh and vim with its visual mode, will need to look at this question to fill the gap: Clipboard over SSH session through VIM (Hint: no xserver needed on the server side) Jul 10, 2013 at 23:33
4

autocutsel is a lightweight tool that merges the contents of both clipboards. You might also consider using a full-blown clipboard manager, like Shawn suggested.

3

Presumably, you are trying to paste into the Terminal using middle-click.

Generally speaking, if you Copy with the application menu, context menu (which usually just triggers the application menu), or ^c (which also usually triggers the app menu), the results are stored to the "Clipboard" selection and can be Pasted with ^v or a corresponding menu.

If you Copy by highlighting text with the mouse, the results are stored to the "Primary" selection and can be Pasted by middle-clicking the target window.

If you select text in your application with the mouse, then use ^c to Copy it manually, you will stored the results in the "Primary" selection with the mouse, and the "Clipboard" selection with the ^c, so they will both match and you don't get confused.

But, if you select text in your app with the keyboard, then hit ^c, and subsequently select some other text (like a target selection to overwrite) the result will not be stored in the "Primary" selection and you will not get the copied text. You will not be able to middle-click to Paste the copied text, but you can use the Terminal application menu or context menu to Paste from the "Clipboard" selection.

Some applications will also fill the "Primary" selection when you Copy to the "Clipboard". This is non-standard behavior and should be avoided and not relied upon.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .