diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-10-11 15:55:58 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-10-11 15:55:58 +0100 |
commit | 2328ddaed1dea77fb21575926b006092ec6b5e24 (patch) | |
tree | 2ec38ac883ec75a7bd1ad796cdfee9b7cd923255 | |
parent | 1db5b3312faeaf2c152daf1b324192378570c375 (diff) | |
download | dotfiles-2328ddaed1dea77fb21575926b006092ec6b5e24.tar.gz |
Add embark-dwim-beginning-of-list
-rw-r--r-- | .emacs.d/lisp/init-minibuffer.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el index 92934c3..41a8984 100644 --- a/.emacs.d/lisp/init-minibuffer.el +++ b/.emacs.d/lisp/init-minibuffer.el @@ -529,6 +529,7 @@ See `+become' and the functions that call it (e.g. `+become-consult-line')." :bind (("C-." . embark-act) ("M-." . embark-dwim) + ([remap xref-find-definitions-current-list-function] . embark-dwim-beginning-of-list) ("C-c C-o" . embark-export) ("C-h b" . embark-bindings) ("C-h B" . describe-bindings) @@ -543,6 +544,14 @@ See `+become' and the functions that call it (e.g. `+become-consult-line')." :custom (prefix-help-command 'embark-prefix-help-command) :config + (defun embark-dwim-beginning-of-list () + "`embark-dwim' at the beginning of the current list. +With a prefix argument, moves up `current-prefix-arg' sexps first." + (progn + (when current-prefix-arg + (sp-backward-up-sexp current-prefix-arg)) + (sp-beginning-of-sexp) + (embark-dwim))) (defalias 'embark-become-ripgrep-parent (kmacro "C-, ^")) (defun embark-preview () "Previews candidate in vertico buffer, unless it's a consult command" |