diff options
author | Ashton Wiersdorf <mail@wiersdorf.dev> | 2023-03-21 11:50:12 -0600 |
---|---|---|
committer | Ashton Wiersdorf <mail@wiersdorf.dev> | 2023-03-21 11:50:12 -0600 |
commit | 132131e6c13bc964091f1507e1fea0821e136a90 (patch) | |
tree | 20262d25810df8389fdf1f4a131d54d55135f304 | |
parent | c0f40005ba5890f82212deedfe81af9bb53c26af (diff) |
Add Embark to base.el
-rw-r--r-- | mixins/base.el | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/mixins/base.el b/mixins/base.el index 4a3f003..24c52ac 100644 --- a/mixins/base.el +++ b/mixins/base.el @@ -1,6 +1,6 @@ ;;; Emacs Bedrock ;;; -;;; Mixin: UI enhancements +;;; Mixin: Base UI enhancements ;;; Usage: Append or require this file from init.el to enable various UI/UX ;;; enhancements. @@ -8,6 +8,7 @@ ;;; Contents: ;;; ;;; - Motion aids +;;; - Power-ups: Embark and Consult ;;; - Minibuffer and completion ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -23,6 +24,42 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; +;;; Power-ups: Embark and Consult +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Consult: Misc. enhanced commands +(use-package consult + :ensure t + ;; Other good things to bind: consult-ripgrep, consult-line-multi, + ;; consult-history, consult-outline, consult-error + :bind (("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ("C-s" . consult-line)) ;; orig. isearch + :config + ;; Narrowing lets you restrict results to certain groups of candidates + (setq consult-narrow-key "<")) + +(use-package embark + :ensure t + :bind (("C-c a" . embark-act)) + :init + ;; Add the option to run embark when using avy + (defun bedrock/avy-action-embark (pt) + (unwind-protect + (save-excursion + (goto-char pt) + (embark-act)) + (select-window + (cdr (ring-ref avy-ring 0)))) + t) + + ;; After invoking avy-goto-char-timer, hit "." to run embark at the next + ;; candidate you select + (setf (alist-get ?. avy-dispatch-alist) 'bedrock/avy-action-embark)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; ;;; Minibuffer and completion ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -71,18 +108,6 @@ :config (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) -;; Consult: Misc. enhanced commands -(use-package consult - :ensure t - ;; Other good things to bind: consult-ripgrep, consult-line-multi, - ;; consult-history, consult-outline, consult-error - :bind (("C-x b" . consult-buffer) ;; orig. switch-to-buffer - ("M-y" . consult-yank-pop) ;; orig. yank-pop - ("C-s" . consult-line)) ;; orig. isearch - :config - ;; Narrowing lets you restrict results to certain groups of candidates - (setq consult-narrow-key "<")) - (use-package eshell :bind (("C-r" . consult-history))) |