How to Make Swiper Choose the Second or Subsequent Match on a Line

Chanyoung is a Swiper user and asks a question I’ve sometimes wondered about: when using swiper, how do you choose the second or subsequent match on a line? If you follow the above link, you will see that abo-abo himself provides the answer.

What you do is call swiper-avy (bound to Ctrl+) to see tags for every visible match. Then you simply choose the correct tag in the usual Avy way. I’ve known about (and even used) swiper-avy for some time but I always thought of it as a way of choosing the correct line in the minibuffer. That usually brings you to the match you want but not (necessarily) when there is more than one match on the line you want.

It turns out—although I somehow never noticed it—that the visible matches in the searched buffer are also tagged so you can simply choose the tag you want and jump right to the desired match. I know I’ve said it before, but if you aren’t using swiper and counsel you owe it to yourself to give them a try. I’m always learning something new that they can do and they’ve made my navigation a lot more efficient.

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