Skip to content

preview-key would conflict with vertico-map's keybind #1085

Answered by honmaple
honmaple asked this question in Q&A
Discussion options

You must be logged in to vote

@minad Thank you.

For anyone has same problem,use preview-key with keymap

  (defvar maple/consult-preview-map
    (let ((map (make-sparse-keymap)))
      (define-key map (kbd "<tab>") #'ignore)
      map))

  (consult-customize
   consult-ripgrep
   :keymap maple/consult-preview-map
   :preview-key "<tab>"
   consult-line
   :preview-key '(:debounce 0.2 any))

If don't want to add every custom command to consult-customize,such as

  (defun maple/consult-grep (&optional dir initial)
    (interactive "P")
    (consult-ripgrep (or dir default-directory) initial))

just use

  (defun maple/consult-grep (&optional dir initial)
    (interactive "P")
    (let ((this-command 'consult-ripgrep))
    …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@honmaple
Comment options

Answer selected by honmaple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1084 on September 14, 2024 13:58.