.emacs.d

my emacs configuration directory
Log | Files | Refs | README

vompec.el (2496B)


      1 ;; -*- lexical-binding: t; -*-
      2 ;;; Configuration for the Vertico (VOMPEC) completion stack.
      3 
      4 (use-package vertico
      5   :init (vertico-mode)
      6   :hook ((rfn-eshadow-update-overlay . vertico-directory-tidy)))
      7 
      8 ;; Prior to Emacs 31, a minibuffer prompt from completing-read-multiple did
      9 ;; nothing to indicate that multiple options could be selected. This is a
     10 ;; patch from the author of vertico.el to work around it.
     11 ;; Displays [CRM<separator>], e.g., [CRM,] if the separator is a comma.
     12 (when (< emacs-major-version 31)
     13   (advice-add #'completing-read-multiple :filter-args
     14               (lambda (args)
     15                 (cons (format "[CRM%s] %s"
     16                               (string-replace "[ \t]*" "" crm-separator)
     17                               (car args))
     18                       (cdr args)))))
     19 
     20 ;; Do not allow the cursor in the minibuffer prompt
     21 (setq minibuffer-prompt-properties
     22       '(read-only t cursor-intangible t face minibuffer-prompt))
     23 
     24 ;; Hide commands in M-x which do not work in the current mode.
     25 (setq read-extended-command-predicate #'command-completion-default-include-p)
     26 
     27 (use-package orderless
     28   :init
     29   (setq completion-styles '(orderless basic)
     30         completion-category-defaults nil
     31         completion-category-overrides '((file (styles partial-completion)))))
     32 
     33 (use-package marginalia
     34   :bind
     35   (:map minibuffer-local-map
     36    ("M-A" . marginalia-cycle))
     37   :init (marginalia-mode))
     38 
     39 (use-package prescient)
     40 (use-package vertico-prescient
     41   :init (vertico-prescient-mode))
     42 
     43 (use-package embark
     44   :bind
     45   (("C-." . embark-act)
     46    ("M-." . embark-dwim)
     47    ("C-h B" . embark-bindings)))
     48 
     49 (use-package consult
     50   :bind ;; TODO bind the other commands
     51   (("C-c M-x" . consult-mode-command)
     52    ("C-c h" . consult-history)
     53    ("C-c m" . consult-man)
     54    ("C-c i" . consult-info)
     55    ("C-x M-:" . consult-complex-command)
     56    ("C-x b" . consult-buffer)
     57    ("C-x p b" . consult-project-buffer)
     58    ("M-g g" . consult-goto-line)
     59    ("M-g M-g" . consult-goto-line)
     60    ("M-g o" . consult-outline)
     61    ("M-g m" . consult-mark)
     62    ("M-g k" . consult-global-mark)
     63    ("M-g i" . consult-imenu)
     64    ("M-g I" . consult-imenu-multi)
     65    ("M-s d" . consult-fd)
     66    ("M-s r" . consult-ripgrep)
     67    ("C-s" . consult-line)
     68    ("M-s L" . consult-line-multi)
     69    ("M-s k" . consult-keep-lines)
     70    ("M-s u" . consult-focus-lines)
     71    :map minibuffer-local-map
     72    ("M-s" . consult-history)
     73    ("M-r" . consult-history)))
     74 
     75 (use-package embark-consult
     76   :hook (embark-collect-mode . consult-preview-at-point-mode))