[Emacs] More avy!

This commit is contained in:
Lucien Cartier-Tilet 2022-07-24 11:41:50 +02:00
parent e88826f8d4
commit 1e1e40160e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -7972,14 +7972,24 @@ either in Emacs or in an external web browser. I prefer the defaults.
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Packages-Configuration-Misc-avyral6fl6184j0 :CUSTOM_ID: Packages-Configuration-Misc-avyral6fl6184j0
:END: :END:
~avy~ is a really convenient way of jumping around, but Ill need some ~avy~ is a really convenient way of jumping around and performing
configuration to make it bépo-compatible. actions on these selections, but Ill need some configuration to make
it bépo-compatible.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package avy (use-package avy
:defer t :defer t
:straight t :straight t
:config :config
(setq avy-keys '(?a ?u ?i ?e ?c ?t ?s ?r ?n)) (csetq avy-keys '(?a ?u ?i ?e ?c ?t ?s ?r ?n)
avy-dispatch-alist '((?x . avy-action-kill-move)
(?X . avy-action-kill-stay)
(?T . avy-action-teleport)
(?m . avy-action-mark)
(?C . avy-action-copy)
(?y . avy-action-yank)
(?Y . avy-action-yank-line)
(?I . avy-action-ispell)
(?z . avy-action-zap-to-char)))
(defun my/avy-goto-url () (defun my/avy-goto-url ()
"Jump to url with avy." "Jump to url with avy."
(interactive) (interactive)
@ -7991,15 +8001,40 @@ configuration to make it bépo-compatible.
(browse-url-at-point)) (browse-url-at-point))
:general :general
(phundrak/evil (phundrak/evil
:packages 'avy :pakages 'avy
"gl" #'avy-goto-line) "gc" #'evil-avy-goto-char-timer
"gl" #'evil-avy-goto-line)
(phundrak/leader-key (phundrak/leader-key
:packages 'avy :packages 'avy
:infix "j" :infix "j"
"j" #'evil-avy-goto-char-timer "b" #'avy-pop-mark
"l" #'evil-avy-goto-line "c" #'evil-avy-goto-char-timer
"u" #'my/avy-goto-url "l" #'avy-goto-line)
"U" #'my/avy-open-url)) (phundrak/leader-key
:packages 'avy
:infix "A"
"c" '(:ignore t :which-key "copy")
"cl" #'avy-copy-line
"cr" #'avy-copy-region
"k" '(:ignore t :which-key "kill")
"kl" #'avy-kill-whole-line
"kL" #'avy-kill-ring-save-whole-line
"kr" #'avy-kill-region
"kR" #'avy-kill-ring-save-region
"m" '(:ignore t :which-key "move")
"ml" #'avy-move-line
"mr" #'avy-move-region
"mt" #'avy-transpose-lines-in-region
"n" #'avy-next
"p" #'avy-prev
"u" #'my/avy-goto-url
"U" #'my/avy-open-url)
(phundrak/major-leader-key
:packages '(avy org)
:keymaps 'org-mode-map
"A" '(:ignore t :which-key "avy")
"Ar" #'avy-org-refile-as-child
"Ah" #'avy-org-goto-heading-timer))
#+end_src #+end_src
*** Calc *** Calc
@ -8337,7 +8372,6 @@ My keybinds for jumping around are prefixed by ~j~.
| Key | Function | Description | | Key | Function | Description |
|-----+-------------------------+-------------| |-----+-------------------------+-------------|
| | | jump | | | | jump |
| c | counsel-dired-jump | |
| f | counsel-file-jump | | | f | counsel-file-jump | |
| d | dired-jump | | | d | dired-jump | |
| D | dired-jump-other-window | | | D | dired-jump-other-window | |