I was using ivy+swiper for a while, and it has swiper-from-isearch which gives a nice occur-like UI for finding isearch matches. I switched to vertico + consult recently.

I see that consult has consult-line which you can bind into isearch-mode-map, but it's not the same, because it does regexp matching rather than literal string matching.

Is there a version of consult-line that matches the same way plain (non-regexp) Isearch does?

  • Are u using orderless? The default completion-styles of Emacs don't support regexp. Mar 28, 2022 at 1:56
  • I'm not sure what you're looking for. Does swiper do what you want? Why don't you keep using that?
    – Tyler
    Mar 31, 2022 at 18:37

2 Answers 2

 (use-package orderless
 :ensure t
 (setq completion-styles '(orderless)
   completion-category-defaults nil
   completion-category-overrides '((file (styles . (partial-completion))))))    

You have to install orderless, and consult-line with work as swiper.


This should be similar to swiper-from-isearch:

(defun consult-line-from-isearch ()
  "Call `consult-line` with the search string from the last `isearch`."
  (consult-line isearch-string))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.