6

When using swiper for search, it only shows the number of matching lines. How can I view the number of matches?

Basil
  • 12,019
  • 43
  • 69
xuhdev
  • 1,839
  • 13
  • 26
  • I don't think this is currently supported, so you may want to submit a feature request: https://github.com/abo-abo/swiper/issues – Basil Jun 19 '18 at 19:45
  • 1
    Support for this was added in a new command `swiper-isearch`. See https://github.com/abo-abo/swiper/issues/1931 – Basil Apr 04 '19 at 03:15

2 Answers2

1

https://github.com/abo-abo/swiper/issues/1931#issuecomment-479513287

"Please test swiper-isearch. It's no longer line-based like swiper, which makes it display the total number of matches. It also fixes the slow startup of swiper"

junnu
  • 770
  • 3
  • 12
-2
(setq ivy-display-style 'fancy
        ivy-count-format "(%d/%d) " ; this is what you want
        ivy-initial-inputs-alist nil ; remove initial ^ input.
        ivy-extra-directories nil ; remove . and .. directory.)

This is from the :init of my (use-package swiper ...) declaration.

yPhil
  • 963
  • 5
  • 22
  • 3
    `ivy-count-format` shows the current out of the total number of matching **lines**, not **substrings**. This does not do what OP is asking for. – Basil Mar 21 '18 at 21:43