aboutsummaryrefslogtreecommitdiff
path: root/modules/selection-framework.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/selection-framework.el')
-rw-r--r--modules/selection-framework.el28
1 files changed, 21 insertions, 7 deletions
diff --git a/modules/selection-framework.el b/modules/selection-framework.el
index 116873374..a567e8003 100644
--- a/modules/selection-framework.el
+++ b/modules/selection-framework.el
@@ -37,16 +37,25 @@
(vertico-resize nil) ; Don't resize the minibuffer
(vertico-sort-function #'vertico-sort-history-alpha) ; History first, then alphabetical
:bind (:map vertico-map
- ("C-j" . vertico-next)
- ("C-k" . vertico-previous)
- ("C-l" . vertico-insert) ; Insert current candidate
- ("RET" . vertico-exit)
- ("C-RET" . vertico-exit-input)
- ("M-RET" . minibuffer-force-complete-and-exit)
- ("TAB" . minibuffer-complete))
+ ("C-j" . vertico-next)
+ ("C-k" . vertico-previous)
+ ("C-l" . vertico-insert) ; Insert current candidate
+ ("RET" . vertico-exit)
+ ("C-RET" . vertico-exit-input)
+ ("M-RET" . minibuffer-force-complete-and-exit)
+ ("TAB" . minibuffer-complete)
+ ;; Page-Up/Down scroll the candidate page instead of falling
+ ;; through to minibuffer history (which selected + dismissed).
+ ("<next>" . vertico-scroll-up)
+ ("<prior>" . vertico-scroll-down))
:init
(vertico-mode))
+;; Save each completion session so `vertico-repeat' (the second C-s in
+;; `cj/consult-line-or-repeat') has a session to resume. `vertico-repeat-save'
+;; is autoloaded, so this defers loading vertico-repeat until the first minibuffer.
+(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)
+
(use-package marginalia
:demand t
:custom
@@ -246,6 +255,11 @@
(use-package vertico-prescient
:demand t
+ :custom
+ ;; orderless does the matching; prescient only sorts. Without this,
+ ;; vertico-prescient-mode's default filtering overrides completion-styles to
+ ;; prescient inside vertico sessions, leaving the orderless config above dead.
+ (vertico-prescient-enable-filtering nil)
:config
(vertico-prescient-mode))