Ivy Selection Algorithms

Today I learned that a capability I’ve often wished for already exists. As I’ve written many times, I use the Ivy/Counsel/Swiper package for my searching and selection needs. Although it took me a day or two to get used to it, I’ve come to really like the default matching algorithm which essentially turns a space into “.*”. Now I consider it a cache miss if I have to actually enter regex notation.

Ivy supports several matching algorithms and you can choose the one you want to use with each application, such as Swiper. One such algorithm is to search for a target that contains two or more terms without regard to the order they occur in. My use case for that is searching for an old blog post. I’d sometimes like to search for several words without regard to their order. That’s useful when I can remember two or three terms in the post but not the order they appeared in.

Sadly, though, there was no way to choose an algorithm on-the-fly and I normally want to use the default algorithm. Happily abo-abo fixed that problem back in July. You can now cycle through the various matching algorithms. The details are in this Emacs Stack Exchange question. This is a real win for me and makes Swiper and Ivy even more useful for my workflow.

If you aren’t already using Ivy/Counsel/Swiper, you’re missing out and really should give it a try. As I’ve said before, it’s my most useful package.

This entry was posted in General and tagged . Bookmark the permalink.