about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-08-13 11:29:14 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-08-13 11:29:14 +0100
commit0199d6636332c0dc9e71d3a5c822f4f347550d56 (patch)
treed0f6fbac5bdd30147c10d9f014ca534c1fc14773
parent0047ed85a332e1875b29dbbb8134b06e9386e58c (diff)
downloaddotfiles-0199d6636332c0dc9e71d3a5c822f4f347550d56.tar.gz
Use avy-goto-char-timer
-rw-r--r--.emacs.d/lisp/init-navigation.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el
index 45ad209..a722aac 100644
--- a/.emacs.d/lisp/init-navigation.el
+++ b/.emacs.d/lisp/init-navigation.el
@@ -63,6 +63,21 @@ char."
   ("C-@" . goto-char-forward-repeat-last)
   ("C-:" . goto-char-backward-repeat-last))
 
+(use-package avy
+  :config
+  ;; https://karthinks.com/software/avy-can-do-anything/#avy-plus-embark-any-action-anywhere
+  (defun avy-action-embark (pt)
+    (unwind-protect
+        (save-excursion
+          (goto-char pt)
+          (embark-act))
+      (select-window
+       (cdr (ring-ref avy-ring 0))))
+    t)
+  (add-to-list 'avy-dispatch-alist '(111 . avy-action-embark))
+  :bind
+  ("M-`" . avy-goto-char-timer))
+
 (use-package smartscan
   :config
   (global-smartscan-mode t)