From 3d96855db7e3c62370029dcaa7af33512318d06a Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 23 Oct 2021 04:15:54 +0100 Subject: avy and link-hint --- completion.org | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'completion.org') diff --git a/completion.org b/completion.org index d8ba4b4..99524fd 100644 --- a/completion.org +++ b/completion.org @@ -107,7 +107,7 @@ ("C-c I" . consult-project-imenu) ("C-c k" . consult-ripgrep) ("C-c K" . consult-git-grep) - ("C-c l" . consult-locate) + ;; ("C-c l" . consult-locate) ("C-c m" . consult-mode-command) ("C-c s" . consult-line) ("C-x r x" . consult-register) @@ -441,6 +441,42 @@ (add-to-list 'embark-keymap-alist '(spotify-search-item . spotify-item-keymap))) #+end_src +* avy link hints + [[https://karthinks.com/software/avy-can-do-anything/][Avy can do anything | Karthinks]] + #+begin_src emacs-lisp + + (use-package avy + :ensure t + :init (setq avy-style 'pre + avy-background t + avy-single-candidate-jump t) + + :config + + (defun avy-embark-act (pt) + "Use Embark to act on the completion at PT." + (save-excursion + (goto-char pt) + (embark-act))) + (add-to-list 'avy-dispatch-alist '(?\; . avy-embark-act)) + + :bind ("C-c a" . avy-goto-char-timer)) + + (use-package link-hint + :ensure t + :init (setq link-hint-avy-style 'pre) + + :config + + (defun embark-on-link () + (interactive) + (let ((unread-command-events '(?\;))) + (link-hint-open-link))) + + :bind (("C-c L" . link-hint-open-link) + ("C-c l" . embark-on-link))) + + #+end_src * imenu #+begin_src emacs-lisp (use-package imenu -- cgit v1.2.3