xclipboard layer
Table of ContentsClose
1. Description
xclipboard integration layer.
When running Emacs in a terminal, it will attempt to use OSC52 for copying and pasting automatically. This feature is intended for terminals that do not support OSC52, or for users who want advanced clipboard functionality in the terminal.
1.1. Features:
- adds copy support to the X-clipboard from the terminal.
- adds paste support to the X-clipboard from the terminal.
- cliphist package: integration with clipboard managers on Linux and macOS.
2. Requirements
This layer depends on a few platform-specific command-line tools:
- on macOS, this layer calls
pbcopy - on Windows, this layer calls
clip.exe - on GNU/Linux systems, this layer relies on
xselto be available.
Note that xsel might not be installed by default on e.g. Ubuntu systems.
Clipboard manager integration requires Parcellite or ClipIt installed on Linux and Flycut installed on macOS.
For Emacs on a remote server over SSH, X11 forwarding must be enabled and working with a local X server before use.
3. Usage
3.1. Clipboard Manager Integration
Clipboard manager integration can be enabled by setting xclipboard-enable-cliphist to t.
dotspacemacs-configuration-layers '( (xclipboard :variables xclipboard-enable-cliphist t))
3.2. Custom Copy Paste Command
Setting xclipboard-copy-command for copy, xclipboard-paste-command for paste.
dotspacemacs-configuration-layers '( (xclipboard :variables xclipboard-copy-command "utf8clip.exe"))
4. Key bindings
| Key binding | Description |
|---|---|
SPC x p |
Paste clipboard contents at cursor position |
SPC x y |
Copy selection to clipboard |
SPC x P |
paste item from history (cliphist must be enabled) |
SPC x R |
rectangle paste item from history (cliphist must be enabled) |
SPC x s |
select item from history (cliphist must be enabled) |