-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I've been using vanilla iserarch and bound C-s in isearch-mode to consult-line like so
(define-key isearch-mode-map (kbd "C-s") 'consult-line)That enables me to switch to consult-line search when the usual isearch gets to far.
Now I wanted to it similarly with ctlrf and tried this:
(use-package ctrlf
:bind (:map ctrlf-minibuffer-mode-map
("<down>" . ctrlf-next-match)
("<up>" . ctrlf-previous-match)
("C-<down>" . ctrlf-last-match)
("C-<up>" . ctrlf-first-match)
("C-s" . 'consult-line))
:init (ctrlf-mode 1))but for some reason the C-s key is not bound to consult-line but still does ctrlf-next-match.
Any ideas how to solve this?
I tried also
(define-key ctrlf-minibuffer-mode-map (kbd "C-s") 'consult-line)but that did not help either.
Edit:
It turns out to be a bit more complicated. You can't just call consult-line from within the minibuffer. You can use this hack wrap the consult-line call in. Working around the original issue and binding it to C-S-s instead of C-s it looks like this:
(use-package ctrlf
:bind (:map ctrlf-minibuffer-mode-map
("<down>" . ctrlf-next-match)
("<up>" . ctrlf-previous-match)
("C-<down>" . ctrlf-last-match)
("C-<up>" . ctrlf-first-match)
("M-<down>" . ctrlf-forward-alternate)
("M-<up>" . ctrlf-backward-alternate)
("C-S-s" . 'johmue/quit-search-and-consult-line))
:init (ctrlf-mode 1))
(defun johmue/quit-search-and-consult-line ()
(interactive)
(put 'quit 'error-message "")
(run-at-time nil nil
(lambda ()
(put 'quit 'error-message "Quit")
(consult-line ctrlf--last-input)))
(abort-recursive-edit))Metadata
Metadata
Assignees
Labels
No labels