Optionally use consult for some completion tasks

This commit is contained in:
Daniel - 2024-03-23 09:48:28 +01:00
parent 53a0c1b56b
commit 04a714fc8c
Signed by: dbo
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 26 additions and 4 deletions

30
init.el
View File

@ -2144,8 +2144,6 @@ Note that this workaround is incomplete, as explained in this comment."
(bind-key "C-z" #'helm-select-action helm-map)))
(use-package ivy
:commands (ivy-mode
ivy-completion-in-region)
:diminish ivy-mode
:init (setq ivy-use-virtual-buffers t
ivy-magic-tilde nil
@ -2197,6 +2195,27 @@ Note that this workaround is incomplete, as explained in this comment."
; only keep those that are readable
[orderless-match-face-1 orderless-match-face-2]))
(use-package consult
:commands (consult-completion-in-region
consult-goto-line
consult-keep-lines
consult-focus-lines
consult-buffer
consult-imenu
consult-line
consult-mark
consult-yank-pop
consult-outline)
:init (progn
;; Settings taken from https://protesilaos.com/emacs/dotemacs#h:22e97b4c-d88d-4deb-9ab3-f80631f9ff1d
(setq consult-line-numbers-widen t
consult-async-min-input 3
consult-async-input-debounce 0.5
consult-async-input-throttle 0.8
consult-narrow-key nil
consult-preview-key nil))
:config (require 'consult-imenu))
;; * Navigation
@ -2803,7 +2822,7 @@ eventuelly be set to nil, however)."
(use-package ledger-mode
:config (add-hook 'ledger-mode-hook #'(lambda ()
(setq-local completion-in-region-function #'ivy-completion-in-region))))
(setq-local completion-in-region-function #'consult-completion-in-region))))
(use-package markdown-mode
:ensure t
@ -2947,7 +2966,6 @@ eventuelly be set to nil, however)."
minibuffer-depth-indicate-mode
ace-window-display-mode
key-chord-mode
;; ivy-mode
minions-mode
which-key-mode
projectile-mode
@ -3075,6 +3093,10 @@ eventuelly be set to nil, however)."
(bind-key "M-g M-g" #'avy-goto-line)
(bind-key "M-g g" #'avy-goto-line))
(when (package-installed-p 'consult)
(bind-key "M-g i" #'consult-imenu)
(bind-key "C-x b" #'consult-buffer))
;; Environment Variables
(unless on-windows