aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-lisp/packages/rul-completion.el
blob: 190632ec794be03ad914fac5753086f8b54db7d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;; Enable vertico
(use-package vertico
  :init
  (vertico-mode)

  :config
  (add-hook 'rfn-eshadow-update-overlay-hook #'vertico-directory-tidy)

  ;; Different scroll margin
  ;; (setq vertico-scroll-margin 0)

  ;; Show more candidates
  ;; (setq vertico-count 20)

  ;; Grow and shrink the Vertico minibuffer
  ;; (setq vertico-resize t)

  ;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
  ;; (setq vertico-cycle t)
  )

;; Enable rich annotations using the Marginalia package
(use-package marginalia
  ;; Bind `marginalia-cycle' locally in the minibuffer.  To make the binding
  ;; available in the *Completions* buffer, add it to the
  ;; `completion-list-mode-map'.
  :bind (:map minibuffer-local-map
         ("M-A" . marginalia-cycle))

  ;; The :init section is always executed.
  :init

  ;; Marginalia must be actived in the :init section of use-package such that
  ;; the mode gets enabled right away. Note that this forces loading the
  ;; package.
  (marginalia-mode))

(setq completion-styles '(basic partial-completion))
(setq completion-category-overrides
      '(
        (file (styles . (basic partial-completion orderless)))
        (project-file (styles . (flex basic substring partial-completion orderless)))
        ))

(setq completion-ignore-case t)

(provide 'rul-completion)
nihil fit ex nihilo