doomemacs/modules/completion/selectrum/config.el

63 lines
1.8 KiB
EmacsLisp
Raw Normal View History

2021-01-16 03:04:18 +08:00
;;; completion/selectrum/config.el -*- lexical-binding: t; -*-
(use-package! selectrum
2021-01-16 20:21:50 +08:00
:hook (doom-first-input . selectrum-mode)
:config
(setq selectrum-extend-current-candidate-highlight t
selectrum-fix-minibuffer-height t)
(unless (featurep! +orderless)
(setq completion-styles '(substring partial-completion))))
2021-01-16 03:04:18 +08:00
(when (featurep! +prescient)
(use-package! selectrum-prescient
:after selectrum
2021-01-16 20:28:03 +08:00
:hook ((selectrum-mode . selectrum-prescient-mode)
(selectrum-mode . prescient-persist-mode))))
2021-01-16 03:04:18 +08:00
2021-01-16 20:21:50 +08:00
(use-package! orderless
:when (featurep! +orderless)
:config
(setq completion-styles '(orderless)))
2021-01-16 03:04:18 +08:00
(use-package! consult
:defer t
:init
2021-01-16 20:21:50 +08:00
(fset 'multi-occur #'consult-multi-occur)
2021-01-16 03:04:18 +08:00
(define-key!
[remap apropos] #'consult-apropos
[remap goto-line] #'consult-goto-line
[remap imenu] #'consult-imenu
[remap switch-to-buffer] #'consult-buffer
[remap switch-to-buffer-other-window] #'consult-buffer-other-window
[remap switch-to-buffer-other-frame] #'consult-buffer-other-frame
[remap man] #'consult-man
[remap yank-pop] #'consult-yank-pop
[remap locate] #'consult-locate
2021-01-16 20:21:50 +08:00
[remap load-theme] #'consult-theme
[remap recentf-open-files] #'consult-recent-file)
:config
(setq consult-project-root-function #'projectile-project-root))
2021-01-16 03:04:18 +08:00
2021-01-16 20:21:50 +08:00
(use-package! consult-flycheck
:when (featurep! :checkers syntax)
:after (consult flycheck))
2021-01-16 03:04:18 +08:00
(use-package! embark
:init
(define-key!
2021-01-16 20:21:50 +08:00
"C-S-a" #'embark-act)
(define-key! selectrum-minibuffer-map
"C-c C-o" #'embark-export
"C-c C-c" #'embark-act-noexit))
2021-01-16 03:04:18 +08:00
(use-package! marginalia
:after selectrum
:hook (doom-first-input . marginalia-mode)
:init
(setq-default marginalia-annotators '(marginalia-annotators-heavy)))
(use-package! embark-consult
:after (embark consult)
:hook
(embark-collect-mode . embark-consult-preview-minor-mode))