summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2025-11-13 00:46:53 +0100
committercashmere <cashmere@autistici.org>2025-11-13 00:46:53 +0100
commita1f6d9a13d5c706450f754258b3f564209970d0e (patch)
tree96f092bdf88ed573cafdf957e482c8dded99a0b2
parentf04761b165a11be27bc8b45c2088f7b65bbbf087 (diff)
downloademacs-a1f6d9a13d5c706450f754258b3f564209970d0e.tar.gz
add support for tty clipboard
-rw-r--r--config.el17
-rw-r--r--config.org10
2 files changed, 26 insertions, 1 deletions
diff --git a/config.el b/config.el
index 7cb775a..9058d9b 100644
--- a/config.el
+++ b/config.el
@@ -4,6 +4,19 @@
;; (setq gc-cons-threshold #x40000000)
;; (setq gc-cons-threshold 50000000)
;; (setenv "LSP_USE_PLISTS" "true")
+(defun copy-to-osc52 (text &optional push)
+ "Send TEXT to the system clipboard via OSC52."
+ (let ((b64 (base64-encode-string (encode-coding-string text 'utf-8) t)))
+ (send-string-to-terminal (concat "\e]52;c;" b64 "\a"))))
+
+(defun osc52-copy-last-kill ()
+ "Copy last killed text via OSC52."
+ (when kill-ring
+ (copy-to-osc52 (car kill-ring))))
+
+;; Hook into the standard kill commands
+(advice-add 'kill-ring-save :after (lambda (&rest _) (osc52-copy-last-kill)))
+(advice-add 'kill-region :after (lambda (&rest _) (osc52-copy-last-kill)))
(setq lsp-use-plists t)
(setq default-frame-alist '((undecorated . t)))
(setq gc-cons-threshold 100000000)
@@ -224,6 +237,10 @@
(setq my/centered-cursor-enabled t)
(message "centered-cursor on"))))
+(use-package clipetty
+ :ensure t
+ :hook (after-init . global-clipetty-mode))
+
(use-package isearch
:straight nil
:ensure nil ;; This is built-in, no need to fetch it.
diff --git a/config.org b/config.org
index efdaf26..41b2803 100644
--- a/config.org
+++ b/config.org
@@ -6,7 +6,7 @@
* early-init
-#+begin_src emacs-lisp
+#+begin_src emacs-lisp
;;; config.el --- Emacs-Kick --- A feature rich Emacs config for (neo)vi(m)mers -*- lexical-binding: t; -*-
;; (setenv "LSP_USE_PLISTS" "true")
;; (setq debug-on-error '(wrong-type-argument))
@@ -258,6 +258,14 @@
(message "centered-cursor on"))))
#+end_src
+* clipetty
+
+#+begin_src emacs-lisp
+(use-package clipetty
+ :ensure t
+ :hook (after-init . global-clipetty-mode))
+#+end_src
+
* isearch
#+begin_src emacs-lisp