Paste from clipboard managers,
- Parcellite on Linux
- ClipIt on Linux
- https://github.com/erebe/greenclip on Linux
- Flycut on macOS
Users can add their own favorite clipboard managers on any OS easily. See the “Tips” section.
Please note since version 0.6 cliphist uses Emacs builtin API completing-read
instead of ivy-read
from Ivy. So now cliphist can work with any narrow&completion package (helm/ivy/consult/orderless/embark …)
Please install from melpa.
Make sure the clipboard manager is running.
If you use Flycut on macOS, set up “Preferences > General > Clippings” so its value is “Save After each clip”.
M-x cliphist-paste-item
to paste item from history.C-u M-x cliphist-paste-item
rectangle paste itemM-x cliphist-select-item
to select item
If you use “xclip.el” (https://elpa.gnu.org/packages/xclip.html), here is setup,
(require 'xclip)
(setq cliphist-select-item-callback
(lambda (num str)
(xclip-set-selection 'clipboard str)))
If `cliphist-cc-kill-ring` is true, the selected/pasted string will be inserted into kill-ring.
(setq cliphist-cc-kill-ring t)
Set cliphist-linux-clipboard-managers
, cliphist-macos-clipboard-managers
, cliphist-windows-clipboard-managers
to insert/remove clipboard managers.
Here are steps to support a new clipboard manager named “myclip” on Linux.
Step 1, create a file “cliphist-myclip.el” with below content,
(require 'cliphist-sdk)
(defun cliphist-my-read-items ()
(let (rlt
(items '("clip1" "clip2")))
(dolist (item items)
(cliphist-sdk-add-item-to-cache rlt item))
rlt))
(provide 'cliphist-myclip)
Step 2, add (push "myclip" cliphist-linux-clipboard-managers)
into ~/.emacs
.
Set cliphist-greenclip-program
if greenclip program is not added into load-path
and you use greenclip.
Check https://github.com/redguardtoo/cliphist.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.