Add xclip.el for tty clipboard support

Needs more testing
This commit is contained in:
Henrik Lissner 2019-03-06 17:21:38 -05:00
parent 4fbf7a2687
commit d94aa9b57c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 8 additions and 4 deletions

View file

@ -7,6 +7,13 @@
(unless IS-MAC (setq command-line-ns-option-alist nil))
(unless IS-LINUX (setq command-line-x-option-alist nil))
;; Fix the clipboard in terminal or daemon Emacs (non-GUI)
(defun doom|init-clipboard-in-tty-emacs ()
(if IS-MAC
(if (require 'osx-clipboard nil t) (osx-clipboard-mode))
(if (require 'xclip nil t) (xclip-mode))))
(add-hook 'tty-setup-hook #'doom|init-clipboard-in-tty-emacs)
;; stop copying each visual state move to the clipboard:
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
;; grokked from: http://stackoverflow.com/questions/15873346/elisp-rename-macro
@ -30,10 +37,6 @@
;; than a new one
ns-pop-up-frames nil)
;; Fix the clipboard in terminal or daemon Emacs (non-GUI)
(when (or (daemonp) (not (display-graphic-p)))
(add-hook 'doom-init-modules-hook #'osx-clipboard-mode))
(when (or (daemonp) (display-graphic-p))
;; Syncs ns frame parameters with theme (and fixes mismatching text
;; colr in the frame title)

View file

@ -2,6 +2,7 @@
;;; core/packages.el
;; core-os.el
(package! xclip)
(when IS-MAC
(package! exec-path-from-shell)
(package! osx-clipboard)