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.
This commit is contained in:
Itai Y. Efrat 2021-09-15 01:14:49 +03:00
parent 6022579231
commit a612220369
4 changed files with 9 additions and 27 deletions

View file

@ -85,11 +85,11 @@ keybindings are available:
| =C-n= | Go to next candidate |
| =C-k= | (evil) Go to previous candidate |
| =C-j= | (evil) Go to next candidate |
| =C-M-k= | (evil) Go to previous group |
| =C-M-j= | (evil) Go to next group |
| =C-;= or =<leader> a= | Open an ~embark-act~ menu to chose a useful action |
| =C-c C-;= | export the current candidate list to a buffer |
| =C-SPC= | Preview the current candidate |
| =C-M-k= | (evil) Go to previous candidate and preview. |
| =C-M-j= | (evil) Go to next candidate and preview. |
~embark-act~ will prompt you with a =which-key= menu with useful commands on the
selected candidate or candidate list, depending on the completion category. Note
@ -274,9 +274,9 @@ override the module's modifications, do:
;...
)
#+end_src
If you are changing the preview keys (set to =C-SPC=, =C-M-j=, and =C-M-k=),
remember to change their bindings on ~vertico-map~ as well, as the bindings
there get previews to work to an extent on non-consult commands as well.
If you are changing the preview key (set to =C-SPC=), remember to change the
binding on ~vertico-map~ as well, as the binding there gets previews to work to
an extent on non-consult commands as well.
** Marginalia
You can add more Marginalia annotation levels and change the existing ones by
editing ~marginalia-annotator-registry~

View file

@ -134,20 +134,6 @@ Supports exporting consult-grep to wgrep, file to wdeired, and consult-location
(let ((embark-quit-after-action nil))
(embark-dwim)))))
;;;###autoload
(defun +vertico/next-candidate-preview (&optional n)
"Go forward N candidates and preivew"
(interactive)
(vertico-next (or n 1))
(+vertico/embark-preview))
;;;###autoload
(defun +vertico/previous-candidate-preview (&optional n)
"Go backward N candidates and preivew"
(interactive)
(vertico-previous (or n 1))
(+vertico/embark-preview))
(defvar +vertico/find-file-in--history nil)
;;;###autoload
(defun +vertico/find-file-in (&optional dir initial)

View file

@ -117,12 +117,10 @@ overrides `completion-styles' during company completion sessions.")
+default/search-cwd +default/search-other-cwd
+default/search-notes-for-symbol-at-point
consult--source-file consult--source-project-file consult--source-bookmark
:preview-key (list (kbd "C-SPC") (kbd "C-M-j") (kbd "C-M-k")))
:preview-key (kbd "C-SPC"))
(consult-customize
consult-theme
:preview-key
(list (kbd "C-SPC") (kbd "C-M-j") (kbd "C-M-k")
:debounce 0.5 'any))
:preview-key (list (kbd "C-SPC") :debounce 0.5 'any))
(after! org
(defvar +vertico--consult-org-source
`(:name "Org"

View file

@ -209,11 +209,9 @@
"M-RET" #'vertico-exit-input
"C-SPC" #'+vertico/embark-preview
"C-j" #'vertico-next
"C-M-j" #'+vertico/next-candidate-preview
"C-S-j" #'vertico-next-group
"C-M-j" #'vertico-next-group
"C-k" #'vertico-previous
"C-M-k" #'+vertico/previous-candidate-preview
"C-S-k" #'vertico-previous-group)))
"C-M-k" #'vertico-previous-group)))
;;; :ui