Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
;;; packages.el --- xclipboard layer packages file for Spacemacs.
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; Authors: Charles Weill <weill@google.com>
|
|
|
|
;; Google LLC.
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2018-05-11 04:19:21 +00:00
|
|
|
(defconst xclipboard-packages
|
|
|
|
'(
|
|
|
|
(spacemacs-xclipboard :location local)
|
|
|
|
))
|
Add X clipboard support layer to terminal emacs.
The X clipboard allows a user to copy and paste content between different X
windows, e.g. copying text from Chrome into a Terminal. Copy/pasting with the X
clipboard it well supported in GUI Emacs, but not so well in terminal Emacs
(i.e `emacs -nw` or `emacsclient -t`) without resorting to using the mouse,
since terminal Emacs has no awareness of X. There are several incomplete Elisp
solutions out that work for the most part, but may not have cross-platform
support, or may fail over SSH with X forwarding or within a `tmux` session.
This layer adds support for OSX, Linux, Windows, and Cygwin using the relevant
binary on each system. For example on Linux, it uses `xsel` or `xclip` to
interface with the clipboard, depending which one is available. It also adds
support for ssh'ing into a different OS with X forwarding via `ssh -Y hostname`,
and copy/pasting to and from a remote terminal Emacs. It also supports an edge
case of continuing to work in an Emacs instance running inside a `tmux` session
which may have been started by a different ssh session, which relies on
explicitly reseting the `$DISPLAY` environment variable before calling the
relevant binary.
Yank code inspired by https://github.com/tmux-plugins/tmux-yank.
Fix #4662.
Tried to add xclip support but removed it since it freezes.
2017-05-08 03:08:52 +00:00
|
|
|
|
2018-05-11 04:29:05 +00:00
|
|
|
(defun xclipboard/init-spacemacs-xclipboard ()
|
|
|
|
(use-package spacemacs-xclipboard
|
2018-05-11 04:19:21 +00:00
|
|
|
:init (spacemacs/set-leader-keys
|
|
|
|
"xp" 'spacemacs/xclipboard-copy
|
|
|
|
"xy" 'spacemacs/xclipboard-paste)))
|