0

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?

2
  • Are u using orderless? The default completion-styles of Emacs don't support regexp. Commented 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
    Commented Mar 31, 2022 at 18:37

2 Answers 2

1
 (use-package orderless
 :ensure t
 :init
 (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.

1

This should be similar to swiper-from-isearch:

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

Your Answer

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

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