diff options
Diffstat (limited to 'emacs/libs/minad.el')
-rw-r--r-- | emacs/libs/minad.el | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/emacs/libs/minad.el b/emacs/libs/minad.el new file mode 100644 index 0000000..3b9ca4e --- /dev/null +++ b/emacs/libs/minad.el @@ -0,0 +1,89 @@ +;;; package --- Summary + +;;; Commentary: + +;; This loads vertico, corfu, orderless, etc. +;; All from https://github.com/minad + + +;;; Code: + +(require 'package) + +(use-package corfu + :ensure t + :custom + (corfu-cycle t) + :hook ((prog-mode . corfu-mode) + (shell-mode . corfu-mode) + (eshell-mode . corfu-mode)) + :init (global-corfu-mode)) + +(use-package orderless + :ensure t + :init + ;; Configure a custom style dispatcher (see the Consult wiki) + (setq orderless-style-dispatchers nil + orderless-component-separator #'orderless-escapable-split-on-space) + (setq completion-styles '(orderless basic) + completion-category-defaults nil + completion-category-overrides '((file (styles basic partial-completion))))) + +(setq completion-styles '(orderless basic)) + + +;; Use dabbrev with Corfu! +(use-package dabbrev + ;; Swap M-/ and C-M-/ + :bind (("M-/" . dabbrev-expand) + ("C-M-/" . dabbrev-completion))) + +;; Enable richer annotations using the Marginalia package +(use-package marginalia + :ensure t + ;; Either bind `marginalia-cycle` globally or only in the minibuffer + ;; :bind (("M-A" . marginalia-cycle) + ;; :map minibuffer-local-map + ;; ("M-A" . marginalia-cycle)) + + ;; The :init configuration is always executed (Not lazy!) + :init + + ;; Must be in the :init section of use-package such that the mode gets + ;; enabled right away. Note that this forces loading the package. + (marginalia-mode)) + +(use-package vertico + :ensure t + ;; Special recipe to load extensions conveniently + :straight (vertico :files (:defaults "extensions/*") + :includes (vertico-indexed + vertico-flat + vertico-grid + vertico-mouse + vertico-quick + vertico-buffer + vertico-repeat + vertico-reverse + vertico-directory + vertico-multiform + vertico-unobtrusive + )) + ;; :general + ;; (:keymaps 'vertico-map + ;; "<tab>" #'vertico-insert ; Choose selected candidate + ;; "<escape>" #'minibuffer-keyboard-quit ; Close minibuffer + ;; ;; NOTE 2022-02-05: Cycle through candidate groups + ;; "C-M-n" #'vertico-next-group + ;; "C-M-p" #'vertico-previous-group) + :custom + (vertico-count 12) ; Number of candidates to display + (vertico-resize t) + (vertico-cycle nil) ; Go from last to first candidate and first to last (cycle)? + :config + (vertico-mode) + (vertico-reverse-mode)) + +(provide 'minad) + +;;; minad.el ends here |