Skip to content

Commit a612220

Browse files
committed
refactor!(vertico): evil minibuffer keybindings
BREAKING CHANGE: remove +vertico/(next|previous)-candidate-preview. BREAKING CHANGE: Move vertico-(next|previous)-group to C-M-j/k now that C-S-j/k now default back to scrolling up and down pages. Update docs to reflect these changes.
1 parent 6022579 commit a612220

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

modules/completion/vertico/README.org

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ keybindings are available:
8585
| =C-n= | Go to next candidate |
8686
| =C-k= | (evil) Go to previous candidate |
8787
| =C-j= | (evil) Go to next candidate |
88+
| =C-M-k= | (evil) Go to previous group |
89+
| =C-M-j= | (evil) Go to next group |
8890
| =C-;= or =<leader> a= | Open an ~embark-act~ menu to chose a useful action |
8991
| =C-c C-;= | export the current candidate list to a buffer |
9092
| =C-SPC= | Preview the current candidate |
91-
| =C-M-k= | (evil) Go to previous candidate and preview. |
92-
| =C-M-j= | (evil) Go to next candidate and preview. |
9393

9494
~embark-act~ will prompt you with a =which-key= menu with useful commands on the
9595
selected candidate or candidate list, depending on the completion category. Note
@@ -274,9 +274,9 @@ override the module's modifications, do:
274274
;...
275275
)
276276
#+end_src
277-
If you are changing the preview keys (set to =C-SPC=, =C-M-j=, and =C-M-k=),
278-
remember to change their bindings on ~vertico-map~ as well, as the bindings
279-
there get previews to work to an extent on non-consult commands as well.
277+
If you are changing the preview key (set to =C-SPC=), remember to change the
278+
binding on ~vertico-map~ as well, as the binding there gets previews to work to
279+
an extent on non-consult commands as well.
280280
** Marginalia
281281
You can add more Marginalia annotation levels and change the existing ones by
282282
editing ~marginalia-annotator-registry~

modules/completion/vertico/autoload/vertico.el

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,6 @@ Supports exporting consult-grep to wgrep, file to wdeired, and consult-location
134134
(let ((embark-quit-after-action nil))
135135
(embark-dwim)))))
136136

137-
;;;###autoload
138-
(defun +vertico/next-candidate-preview (&optional n)
139-
"Go forward N candidates and preivew"
140-
(interactive)
141-
(vertico-next (or n 1))
142-
(+vertico/embark-preview))
143-
144-
;;;###autoload
145-
(defun +vertico/previous-candidate-preview (&optional n)
146-
"Go backward N candidates and preivew"
147-
(interactive)
148-
(vertico-previous (or n 1))
149-
(+vertico/embark-preview))
150-
151137
(defvar +vertico/find-file-in--history nil)
152138
;;;###autoload
153139
(defun +vertico/find-file-in (&optional dir initial)

modules/completion/vertico/config.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ overrides `completion-styles' during company completion sessions.")
117117
+default/search-cwd +default/search-other-cwd
118118
+default/search-notes-for-symbol-at-point
119119
consult--source-file consult--source-project-file consult--source-bookmark
120-
:preview-key (list (kbd "C-SPC") (kbd "C-M-j") (kbd "C-M-k")))
120+
:preview-key (kbd "C-SPC"))
121121
(consult-customize
122122
consult-theme
123-
:preview-key
124-
(list (kbd "C-SPC") (kbd "C-M-j") (kbd "C-M-k")
125-
:debounce 0.5 'any))
123+
:preview-key (list (kbd "C-SPC") :debounce 0.5 'any))
126124
(after! org
127125
(defvar +vertico--consult-org-source
128126
`(:name "Org"

modules/config/default/+evil-bindings.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,9 @@
209209
"M-RET" #'vertico-exit-input
210210
"C-SPC" #'+vertico/embark-preview
211211
"C-j" #'vertico-next
212-
"C-M-j" #'+vertico/next-candidate-preview
213-
"C-S-j" #'vertico-next-group
212+
"C-M-j" #'vertico-next-group
214213
"C-k" #'vertico-previous
215-
"C-M-k" #'+vertico/previous-candidate-preview
216-
"C-S-k" #'vertico-previous-group)))
214+
"C-M-k" #'vertico-previous-group)))
217215

218216

219217
;;; :ui

0 commit comments

Comments
 (0)