blob: 6fa506138829c6a48e1c5a34ebd80128a581894e (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
;; -*- lexical-binding: t -*-
(when (gx/maybe-require-package 'vertico)
(add-hook 'after-init-hook #'vertico-mode))
(setq vertico-resize t
vertico-count 20
vertico-cycle t)
(setq completion-ignore-case t
read-file-name-completion-ignore-case t
read-buffer-completion-ignore-case t)
(with-eval-after-load 'vertico
(define-key vertico-map (kbd "C-c j") 'vertico-quick-jump)
(define-key vertico-map (kbd "C-c C-j") 'vertico-quick-jump)
(define-key vertico-map (kbd "C-d")
(lambda () (interactive) (vertico-next (/ vertico-count 2))))
(define-key vertico-map (kbd "C-u")
(lambda () (interactive) (vertico-previous (/ vertico-count 2)))))
(when (gx/maybe-require-package 'consult)
(with-eval-after-load 'evil
(evil-define-key 'normal 'global
(kbd "<leader>fb") 'consult-buffer
(kbd "<leader>fm") 'consult-recent-file
(kbd "<leader>fc") 'execute-extended-command
(kbd "<leader>fl") 'consult-line
(kbd "<leader>fs") 'consult-imenu
(kbd "<leader>fa") 'consult-org-agenda)
(evil-define-key 'normal 'eglot--managed-mode
(kbd "<leader>fS") 'consult-eglot-symbols)))
(when (executable-find "rg")
(setq affe-grep-command
"rg --null --line-buffered --color=never --max-columns=1000 \
--path-separator / -v ^$ \
--smart-case --no-heading --line-number --hidden --glob !.git ."))
(when (executable-find "fd")
(setq affe-find-command
"fd --type f --hidden --follow --exclude .git"))
(when (gx/maybe-require-package 'affe)
(with-eval-after-load 'evil
(evil-define-key 'normal 'global
(kbd "<leader>ff") 'affe-find
(kbd "<leader>fr") 'affe-grep))
(with-eval-after-load 'orderless
(defun gx/affe-orderless-regexp-compiler (input _type _ignorecase)
(setq input (orderless-pattern-compiler input))
(cons input (lambda (str) (orderless--highlight input str))))
(setq affe-regexp-compiler #'gx/affe-orderless-regexp-compiler))
(with-eval-after-load 'consult
(consult-customize
affe-grep affe-find
:preview-key (kbd "C-c C-p"))))
(setq consult-preview-key (kbd "C-c C-p"))
(when (gx/maybe-require-package 'savehist)
(add-hook 'after-init-hook #'savehist-mode))
(provide 'init-minibuffer)
|