aboutsummaryrefslogtreecommitdiff
path: root/extras/base.el
diff options
context:
space:
mode:
authorAshton Wiersdorf <mail@wiersdorf.dev>2023-09-08 09:39:55 -0600
committerAshton Wiersdorf <mail@wiersdorf.dev>2023-09-08 09:39:55 -0600
commitf4f88ea6ac2affdac4246b9e6a6a4ec3fdeb92f5 (patch)
tree27e070be909dcd9210ad092b8341500d64aca12b /extras/base.el
parent9e2f11f7b2e3b00c04af09c984e942ce027adecc (diff)
Rename mixin → extra
Diffstat (limited to 'extras/base.el')
-rw-r--r--extras/base.el134
1 files changed, 134 insertions, 0 deletions
diff --git a/extras/base.el b/extras/base.el
new file mode 100644
index 0000000..26ffc9a
--- /dev/null
+++ b/extras/base.el
@@ -0,0 +1,134 @@
+;;; Emacs Bedrock
+;;;
+;;; Extra config: Base UI enhancements
+
+;;; Usage: Append or require this file from init.el to enable various UI/UX
+;;; enhancements.
+
+;;; Contents:
+;;;
+;;; - Motion aids
+;;; - Power-ups: Embark and Consult
+;;; - Minibuffer and completion
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Motion aids
+;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(use-package avy
+ :ensure t
+ :demand t
+ :bind (("C-c j" . avy-goto-line)
+ ("s-j" . avy-goto-char-timer)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; 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
+ :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
+ :demand t
+ :after avy
+ :bind (("C-c a" . embark-act)) ; bind this to an easy key to hit
+ :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))
+
+(use-package embark-consult
+ :ensure t)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;; Minibuffer and completion
+;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Vertico: better vertical completion for minibuffer commands
+(use-package vertico
+ :ensure t
+ :init
+ ;; You'll want to make sure that e.g. fido-mode isn't enabled
+ (vertico-mode))
+
+(use-package vertico-directory
+ :after vertico
+ :bind (:map vertico-map
+ ("M-DEL" . vertico-directory-delete-word)))
+
+;; Marginalia: annotations for minibuffer
+(use-package marginalia
+ :ensure t
+ :config
+ (marginalia-mode))
+
+;; Popup completion-at-point
+(use-package corfu
+ :ensure t
+ :init
+ (global-corfu-mode)
+ :bind
+ (:map corfu-map
+ ("SPC" . corfu-insert-separator)
+ ("C-n" . corfu-next)
+ ("C-p" . corfu-previous)))
+
+;; Part of corfu
+(use-package corfu-popupinfo
+ :after corfu
+ :hook (corfu-mode . corfu-popupinfo-mode)
+ :custom
+ (corfu-popupinfo-delay '(0.25 . 0.1))
+ (corfu-popupinfo-hide nil)
+ :config
+ (corfu-popupinfo-mode))
+
+;; Make corfu popup come up in terminal overlay
+(use-package corfu-terminal
+ :if (not (display-graphic-p))
+ :ensure t
+ :config
+ (corfu-terminal-mode))
+
+;; Pretty icons for corfu
+(use-package kind-icon
+ :if (display-graphic-p)
+ :ensure t
+ :after corfu
+ :config
+ (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
+
+(use-package eshell
+ :bind (("C-r" . consult-history)))
+
+;; Orderless: powerful completion style
+(use-package orderless
+ :ensure t
+ :config
+ (setq completion-styles '(orderless)))