From 0f873d646031971dd37824181b65ce457576749e Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Mon, 25 Sep 2023 09:33:17 -0300 Subject: Add emacs configuration --- emacs/libs/minad.el | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 emacs/libs/minad.el (limited to 'emacs/libs/minad.el') 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 + ;; "" #'vertico-insert ; Choose selected candidate + ;; "" #'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 -- cgit v1.2.3-70-g09d2