summary refs log tree commit diff
path: root/emacs/custom/my-completion.el
blob: 487045b0f2ff0495c98fd3a5801497872bbac90d (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;; my-completion.el --- Configure parts related to completion
;;; Commentary:
;;; Code:

(require 'use-package)

(use-package vertico
  :ensure t
  :init
  (vertico-mode)
  (vertico-multiform-mode 1)
  (setq vertico-multiform-commands
        '((consult-imenu buffer indexed)
          (consult-org-heading buffer indexed)
          (consult-outline buffer indexed))))

(use-package marginalia
  :ensure t
  :init
  (marginalia-mode))

(use-package consult
  :ensure t
  :bind (("C-c h"   . consult-history)
         ("C-c m"   . consult-mode-command)
         ("C-x b"   . consult-buffer)
         ("C-x 4 b" . consult-buffer-other-window)
         ("C-x r b" . consult-bookmark)
         ("C-x p b" . consult-project-buffer)
         ("M-y"     . consult-yank-pop)
         ("M-g e"   . consult-compile-error)
         ("M-g f"   . consult-flymake)
         ("M-g M-g" . consult-goto-line)
         ("M-g O"   . consult-outline)
         ("M-g o"   . consult-org-heading)
         ("M-g m"   . consult-mark)
         ("M-g k"   . consult-global-mark)
         ("C-c i"   . consult-imenu)
         ("C-c f"   . consult-git-grep)
         ("C-c /"   . consult-ripgrep)
         ("M-s l"   . consult-line)
         ("M-s L"   . consult-line-multi)
         ("M-s m"   . consult-multi-occur)
         ("M-s k"   . consult-keep-lines)
         ;; Isearch integration
         ("M-s e" . consult-isearch-history)
         :map isearch-mode-map
         ("M-e" . consult-isearch-history)   ;; orig. isearch-edit-string
         ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
         ("M-s l" . consult-line) ;; needed by consult-line to detect isearch
         ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
         ))

(use-package corfu
  :ensure t
  :custom
  (corfu-cycle t)  ;; Enable cycling for `corfu-next/previous'
  (corfu-auto t)   ;; Enable auto completion
  :init
  (corfu-global-mode))

(provide 'my-completion)
;;; my-completion.el ends here