Thursday, February 12, 2015

Emacs Middle Mouse Click with Keyboard

It is possible to get Emacs to perform the same action as clicking the middle mouse button via the keyboard, but it requires some updates to .emacs.

;; Pull from PRIMARY (same as middle mouse click)
(defun get-primary ()
  (interactive)
  (insert
   (gui-get-primary-selection)))
(global-set-key "\C-c\C-y" 'get-primary)