Copy-on-select, paste-on-middle-click on Mac OS X?

Is there a way to give OS X the usual X-windows behavior where selecting text in any application automatically copies it to the clipboard, and the middle mouse button automatically pastes it?

command+C, command+V is a little annoying.


Solution 1:

This has already been discussed (and answered) on apple.stackexchange.com. The accepted answer in that discussion was to use Better Touch Tool.

However, all those solutions that suggest using some tool to map a mouse click to Cmd-V do not completely mimic the behaviour of X, where you can have different content in the mouse-controlled buffer and the keyboard-controlled buffer (i.e., you can paste two different strings depending on whether you middle-click or press CTRL-V).

Solution 2:

Just for the archives: what you want does actually work in Terminal, but only in the very same Terminal window:

Select some text (and release the mouse button), and use the middle mouse button to paste.

Alternatively, when using the trackpad or a two-button mouse: after selecting, click and drag the selection just a bit; you'll see the pointer change. Now, when you let go of the button, the selected text is pasted at your cursor. Hitting Esc while dragging cancels.

drag and drop

Of course, Terminal is just one out of many programs. But for me, it is the only place I actually want this behaviour, if only because of Spiff's comment about being able to replace (mouse) selected text with what's on the clipboard.

Solution 3:

If you just need it for Terminal then you can install iTerm2 which is a terminal which has the X windows cut and paste.

Solution 4:

I just tried Terminal (OS X El Capitan, Version 10.11.5). The process I used is this:

  1. Highlight text
  2. Holding 1 finger, drag a bit up (the highlighted text moves and green '+' appears)
  3. Release and the highlighted text appears in the command line

Solution 5:

You might try fiddling with your mouse settings to see if the driver lets you assign the paste function to middle-click. If it doesn't, try looking into USB Overdrive.

As for copy-on-select, I am unaware of any software that gives you this functionality, and judging from what I can find on Google, none probably exists.