From 0ee7fa9c382ae30295f0b8d88457f7856c7ff800 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 16 Oct 2024 22:04:33 +0200 Subject: emacs: Overhaul configuration completely --- .config/emacs/modules/mm-completion.el | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .config/emacs/modules/mm-completion.el (limited to '.config/emacs/modules/mm-completion.el') 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-" . 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) -- cgit v1.2.3