about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-12-08 16:45:17 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-12-08 16:45:17 +0000
commitf313a8c61d9dd9b6d17744e3c62a42810dca4f81 (patch)
tree658754396bbe3869368336219447dbcb2587ad05 /.emacs.d
parent9d143844bbecde1ea8fd104d59d55091d64c9409 (diff)
downloaddotfiles-f313a8c61d9dd9b6d17744e3c62a42810dca4f81.tar.gz
Add avy-copy-as-kill functions
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-navigation.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el
index 0e0492d..c3b23f1 100644
--- a/.emacs.d/lisp/init-navigation.el
+++ b/.emacs.d/lisp/init-navigation.el
@@ -14,9 +14,23 @@
        (cdr (ring-ref avy-ring 0))))
     t)
   (add-to-list 'avy-dispatch-alist '(111 . avy-action-embark))
+  (defun avy-copy-as-kill ()
+    (interactive)
+    (avy-goto-char-timer)
+    (let ((beg (point)))
+      (avy-goto-char-timer)
+      (copy-region-as-kill beg (point))))
+  (defun avy-kill-in-line ()
+    (interactive)
+    (avy-goto-char-timer)
+    (let ((beg (point)))
+      (call-interactively 'avy-goto-char-in-line)
+      (copy-region-as-kill beg (point))))
   :bind
   ("C-'" . avy-goto-char-timer)
-  ("C-;" . avy-goto-char-in-line))
+  ("C-;" . avy-goto-char-in-line)
+  ("C-c C-'" . avy-copy-as-kill)
+  ("C-c C-;" . avy-copy-as-kill-in-line))
 
 (use-package smartscan
   :config