Add cliphist to the xclipboard layer.
This commit is contained in:
parent
d642095380
commit
cd24a73429
|
@ -2598,6 +2598,10 @@ Other:
|
||||||
(thanks to Voleking)
|
(thanks to Voleking)
|
||||||
**** Xclipboard
|
**** Xclipboard
|
||||||
- Added Requirements documentation (thanks to Chris Glass)
|
- Added Requirements documentation (thanks to Chris Glass)
|
||||||
|
- Added =cliphist= with the following bindings: (thanks to Hong Xu)
|
||||||
|
- ~SPC x P~ paste item from history (cliphist must be enabled)
|
||||||
|
- ~SPC x R~ rectangly paste item from history (cliphist must be enabled)
|
||||||
|
- ~SPC x s~ select item from history (cliphist must be enabled)
|
||||||
**** Ycmd
|
**** Ycmd
|
||||||
- Search for =compile_commands.json= in build sub-directory
|
- Search for =compile_commands.json= in build sub-directory
|
||||||
(thanks to Amos Bird and Eivind Fonn)
|
(thanks to Amos Bird and Eivind Fonn)
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
- [[#description][Description]]
|
- [[#description][Description]]
|
||||||
- [[#features][Features:]]
|
- [[#features][Features:]]
|
||||||
- [[#requirements][Requirements]]
|
- [[#requirements][Requirements]]
|
||||||
|
- [[#usage][Usage]]
|
||||||
|
- [[#clipboard-manager-integration][Clipboard Manager Integration]]
|
||||||
- [[#key-bindings][Key bindings]]
|
- [[#key-bindings][Key bindings]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
|
@ -14,6 +16,7 @@
|
||||||
** Features:
|
** Features:
|
||||||
- adds copy support to the X-clipboard from the terminal.
|
- adds copy support to the X-clipboard from the terminal.
|
||||||
- adds paste support to the X-clipboard from the terminal.
|
- adds paste support to the X-clipboard from the terminal.
|
||||||
|
- [[https://github.com/redguardtoo/cliphist][cliphist]] package: integration with clipboard managers on Linux and Mac.
|
||||||
|
|
||||||
* Requirements
|
* Requirements
|
||||||
This layer depends on a few platform-specific command-line tools:
|
This layer depends on a few platform-specific command-line tools:
|
||||||
|
@ -23,9 +26,23 @@ This layer depends on a few platform-specific command-line tools:
|
||||||
|
|
||||||
Note that =xsel= might not be installed by default on e.g. Ubuntu systems.
|
Note that =xsel= might not be installed by default on e.g. Ubuntu systems.
|
||||||
|
|
||||||
|
Clipboard manager integration requires [[http://parcellite.sourceforge.net/][Parcellite]] or [[https://github.com/CristianHenzel/ClipIt][ClipIt]] installed on Linux
|
||||||
|
and [[https://github.com/TermiT/Flycut][Flycut]] installed on MacOS.
|
||||||
|
|
||||||
|
* Usage
|
||||||
|
** Clipboard Manager Integration
|
||||||
|
Clipboard manager integration can be enabled by setting =xclipboard-enable-cliphist= to =t=.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
dotspacemacs-configuration-layers '(
|
||||||
|
(xclipboard :variables xclipboard-enable-cliphist t))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
* Key bindings
|
* Key bindings
|
||||||
|
|
||||||
| Key binding | Description |
|
| Key binding | Description |
|
||||||
|-------------+---------------------------------------------|
|
|-------------+--------------------------------------------------------------|
|
||||||
| ~SPC x p~ | Paste clipboard contents at cursor position |
|
| ~SPC x p~ | Paste clipboard contents at cursor position |
|
||||||
| ~SPC x y~ | Copy selection to clipboard |
|
| ~SPC x y~ | Copy selection to clipboard |
|
||||||
|
| ~SPC x P~ | paste item from history (cliphist must be enabled) |
|
||||||
|
| ~SPC x R~ | rectangly paste item from history (cliphist must be enabled) |
|
||||||
|
| ~SPC x s~ | select item from history (cliphist must be enabled) |
|
||||||
|
|
15
layers/+tools/xclipboard/config.el
Normal file
15
layers/+tools/xclipboard/config.el
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
;;; config.el --- xclipboard configuration File for Spacemacs
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
|
||||||
|
;;
|
||||||
|
;; Author: Hong Xu <hong@topbug.net>
|
||||||
|
;; URL: https://github.com/syl20bnr/spacemacs
|
||||||
|
;;
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
;;
|
||||||
|
;;; License: GPLv3
|
||||||
|
|
||||||
|
;; Variables
|
||||||
|
|
||||||
|
(defvar xclipboard-enable-cliphist nil
|
||||||
|
"If non-nil, cliphist is enabled.")
|
14
layers/+tools/xclipboard/funcs.el
Normal file
14
layers/+tools/xclipboard/funcs.el
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
;;; funcs.el --- xclipboard layer functions file for Spacemacs.
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
|
||||||
|
;;
|
||||||
|
;; Author: Hong Xu <hong@topbug.net>
|
||||||
|
;; URL: https://github.com/syl20bnr/spacemacs
|
||||||
|
;;
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
;;
|
||||||
|
;;; License: GPLv3
|
||||||
|
|
||||||
|
(defun spacemacs/xclipboard-cliphist-paste-item-rectangle ()
|
||||||
|
(interactive)
|
||||||
|
(cliphist-paste-item 1))
|
|
@ -1,9 +1,10 @@
|
||||||
;;; packages.el --- xclipboard layer packages file for Spacemacs.
|
;;; packages.el --- xclipboard layer packages file for Spacemacs.
|
||||||
;;
|
;;
|
||||||
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
|
||||||
;;
|
;;
|
||||||
;; Authors: Charles Weill <weill@google.com>
|
;; Authors: Charles Weill <weill@google.com>
|
||||||
;; Google LLC.
|
;; Google LLC.
|
||||||
|
;; Hong Xu <hong@topbug.net>
|
||||||
;; URL: https://github.com/syl20bnr/spacemacs
|
;; URL: https://github.com/syl20bnr/spacemacs
|
||||||
;;
|
;;
|
||||||
;; This file is not part of GNU Emacs.
|
;; This file is not part of GNU Emacs.
|
||||||
|
@ -13,8 +14,18 @@
|
||||||
(defconst xclipboard-packages
|
(defconst xclipboard-packages
|
||||||
'(
|
'(
|
||||||
(spacemacs-xclipboard :location local)
|
(spacemacs-xclipboard :location local)
|
||||||
|
(cliphist :requires ivy
|
||||||
|
:toggle xclipboard-enable-cliphist)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(defun xclipboard/init-cliphist ()
|
||||||
|
(use-package cliphist
|
||||||
|
:init (spacemacs/set-leader-keys
|
||||||
|
"xP" 'cliphist-paste-item
|
||||||
|
"xR" 'spacemacs/xclipboard-cliphist-paste-item-rectangle
|
||||||
|
"xs" 'cliphist-select-item)
|
||||||
|
:config (setq cliphist-cc-kill-ring t)))
|
||||||
|
|
||||||
(defun xclipboard/init-spacemacs-xclipboard ()
|
(defun xclipboard/init-spacemacs-xclipboard ()
|
||||||
(use-package spacemacs-xclipboard
|
(use-package spacemacs-xclipboard
|
||||||
:init (spacemacs/set-leader-keys
|
:init (spacemacs/set-leader-keys
|
||||||
|
|
Loading…
Reference in a new issue