selectrum: rework consult previews

- add `C-M-j` and `C-M-k` as preview scrolling keys
- add `consult-theme` to functions that don't get previewed
  automatically (also it works now)
This commit is contained in:
Itai Y. Efrat 2021-05-16 02:54:32 +03:00
parent f372f3aa2c
commit 4e74a221cc
3 changed files with 7 additions and 5 deletions

View file

@ -20,8 +20,6 @@ Need to get it to work for other selectrum commands such =SPC h f=.
#+end_src #+end_src
gets us close but moves the cursor to the new screen which is undesirable. gets us close but moves the cursor to the new screen which is undesirable.
probable best strategy: create an ~embark-preview~ that does this, upstream it. probable best strategy: create an ~embark-preview~ that does this, upstream it.
** TODO ~consult-theme~ is buggy
something to do with doom theme loading modifications
** TODO ripgrep height logic bad ** TODO ripgrep height logic bad
selectrum bug caused by file descriptors selectrum bug caused by file descriptors
https://github.com/raxod502/selectrum/issues/491 https://github.com/raxod502/selectrum/issues/491

View file

@ -96,9 +96,11 @@
consult-line-numbers-widen t consult-line-numbers-widen t
consult-async-input-debounce 0.5 consult-async-input-debounce 0.5
consult-async-input-throttle 0.8) consult-async-input-throttle 0.8)
(setf (alist-get #'consult-bookmark consult-config) (list :preview-key (kbd "C-SPC"))) (mapc
(setf (alist-get #'consult-recent-file consult-config) (list :preview-key (kbd "C-SPC"))) (lambda (x) (setf
(setf (alist-get #'consult--grep consult-config) (list :preview-key (kbd "C-SPC")))) (alist-get x consult-config)
(list :preview-key (list (kbd "C-SPC") (kbd "C-M-j") (kbd "C-M-k")))))
'(consult-bookmark consult-recent-file consult--grep consult-theme)))
(use-package! consult-flycheck (use-package! consult-flycheck
:when (featurep! :checkers syntax) :when (featurep! :checkers syntax)

View file

@ -208,9 +208,11 @@
:map selectrum-minibuffer-map :map selectrum-minibuffer-map
"M-RET" #'selectrum-submit-exact-input "M-RET" #'selectrum-submit-exact-input
"C-j" #'selectrum-next-candidate "C-j" #'selectrum-next-candidate
"C-M-j" #'selectrum-next-candidate ;; with preview, see modules/completion/selectrum/config.el
"C-S-j" #'selectrum-next-page "C-S-j" #'selectrum-next-page
"C-s-j" #'selectrum-goto-end "C-s-j" #'selectrum-goto-end
"C-k" #'selectrum-previous-candidate "C-k" #'selectrum-previous-candidate
"C-M-k" #'selectrum-previous-candidate ;; with preview, see modules/completion/selectrum/config.el
"C-S-k" #'selectrum-previous-page "C-S-k" #'selectrum-previous-page
"C-s-k" #'selectrum-goto-beginning))) "C-s-k" #'selectrum-goto-beginning)))