Simplified access to the system clipboard in Emacs.
(require 'simpleclip) (simpleclip-mode 1) ;; Press super-c to copy without affecting the kill ring. ;; Press super-x or super-v to cut or paste. ;; On OS X, use ⌘-c, ⌘-v, ⌘-x.
By default, Emacs orchestrates a subtle interaction between the internal kill ring and the external system clipboard.
simpleclip-mode radically simplifies clipboard handling: the
system clipboard and the Emacs kill ring are made completely
independent, and never influence each other.
simpleclip-mode also enables support for accessing the system
clipboard from a TTY where possible. You will likely need to
set up custom keybindings if you want to take advantage of that.
To use simpleclip, place the
simpleclip.el library somewhere
Emacs can find it, and add the following to your
(require 'simpleclip) (simpleclip-mode 1)
simpleclip-mode activates clipboard-oriented key
bindings which are modifiable in
The default bindings override keystrokes which may be bound as alternatives for kill/yank commands on your system. "Traditional" kill/yank keys (C-k, C-y, M-y) are unaffected.
The default keybindings are
|super-c (ie ⌘-c)||
|super-x (ie ⌘-x)||
|super-v (ie ⌘-v)||
The super keybindings are friendly for OS X: super is generally mapped to the "command" key ie ⌘. The insert and delete keybindings are better suited for Unix and MS Windows.
x-select-enable-primary is not affected by
Access to the system clipboard from a TTY is provided for those cases where a literal paste is needed -- for example, where autopair interferes with pasted input which is interpreted as keystrokes. If you are already happy with the copy/paste provided by your terminal emulator, then you don't need to set up simpleclip's TTY support.
The following functions may be useful to call from Lisp:
Compatibility and Requirements
GNU Emacs version 25.1 : yes GNU Emacs version 24.5 : yes GNU Emacs version 24.4 : yes GNU Emacs version 24.3 : yes GNU Emacs version 23.3 : yes GNU Emacs version 22.2 : yes, with some limitations GNU Emacs version 21.x and lower : unknown
No external dependencies
Tested on OS X, X11, and MS Windows