summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/mm-completion.el
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-16 22:04:33 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-10-16 22:04:33 +0200
commit0ee7fa9c382ae30295f0b8d88457f7856c7ff800 (patch)
tree6b5a0cf01fa0bfa4d01b0134b268f5d993055c0b /.config/emacs/modules/mm-completion.el
parentd452ae1347b3711bc0a7ac80cfa2c37d9d63836e (diff)
emacs: Overhaul configuration completely
Diffstat (limited to '.config/emacs/modules/mm-completion.el')
-rw-r--r--.config/emacs/modules/mm-completion.el58
1 files changed, 58 insertions, 0 deletions
diff --git a/.config/emacs/modules/mm-completion.el b/.config/emacs/modules/mm-completion.el
new file mode 100644
index 0000000..9ea7746
--- /dev/null
+++ b/.config/emacs/modules/mm-completion.el
@@ -0,0 +1,58 @@
+;;; mm-completion.el --- Configuration for Emacs completion -*- lexical-binding: t; -*-
+
+
+;;; Vertical Completions
+
+(use-package vertico
+ :ensure t
+ :custom
+ (vertico-cycle t)
+ :init
+ (vertico-mode)
+ :config
+ ;; Highlight the current line
+ (require 'hl-line))
+
+
+;;; Annotate Completions
+
+(use-package marginalia
+ :ensure t
+ :custom
+ (marginalia-field-width 50)
+ :init
+ (marginalia-mode))
+
+
+;;; Orderless Completion Style
+
+;; TODO: Make sure this doesn’t suck
+(use-package orderless
+ :ensure t
+ :custom
+ (completion-styles '(orderless basic))
+ (orderless-matching-styles '(orderless-prefixes))
+ (completion-category-overrides '((file (styles basic partial-completion)))))
+
+
+;;; Completion Popups
+
+(use-package corfu
+ :ensure t
+ :hook ((prog-mode . corfu-mode))
+ :bind (:map corfu-map
+ ("C-<return>" . newline))
+ :custom
+ (corfu-auto t)
+ (corfu-cycle t)
+ (corfu-auto-prefix 1)
+ (corfu-auto-delay 0))
+
+
+;;; Save Minibuffer History
+
+(use-package savehist-mode
+ :init
+ (savehist-mode))
+
+(provide 'mm-completion)