Emacs: Add Avy

This commit is contained in:
2024-04-16 10:39:08 -07:00
parent af0f9a8b46
commit 6b7aad14fd

View File

@@ -1,10 +1,33 @@
(provide 'thoom-editing) (provide 'thoom-editing)
;; TODO Support org headings and comments
(defun thoom/move-to-beginnings () (defun thoom/move-to-beginnings ()
"Move between the two beginnings of a line: The very beginning, and the first non-whitespace character." "Move between the two beginnings of a line: The very beginning,
and the first non-whitespace character."
(interactive "^") (interactive "^")
(if (bolp) (if (bolp)
(back-to-indentation) (back-to-indentation)
(move-beginning-of-line 1))) (move-beginning-of-line 1)))
(global-set-key (kbd "C-a") #'thoom/move-to-beginnings)
(use-package emacs
:bind (("C-a" . thoom/move-to-beginnings)))
;; Allow movement during isearch
;; C/M-v move to next/previous match not currently visible
;; M-</> move to first/last match in buffer
(setq isearch-allow-motion t)
(use-package avy
:ensure t
:bind
(("C-j" . avy-goto-char-timer)
([remap goto-line] . avy-goto-line))
:init
(avy-setup-default))
(use-package avy-zap
:ensure t
:bind (("C-z" . avy-zap-up-to-char-dwim)
("M-z" . avy-zap-to-char-dwim)))