summaryrefslogtreecommitdiff
path: root/config.el
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 /config.el
parentf04761b165a11be27bc8b45c2088f7b65bbbf087 (diff)
downloademacs-a1f6d9a13d5c706450f754258b3f564209970d0e.tar.gz
add support for tty clipboard
Diffstat (limited to 'config.el')
-rw-r--r--config.el17
1 files changed, 17 insertions, 0 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.