Coming from helm, I am giving swiper and ivy-mode a shot.

I'm looking for a way to highlight candidates in the way hl-line-mode does: full width background.


  • Is your issue that the entire line is not highlighted but only the text part of the line?
    – Jules
    Mar 7 '16 at 14:36
  • Yes exactly. I don't really know how hl-line works, but it looks like it uses something else than :background whatever. Mar 7 '16 at 14:42
  • It seems like there isn't a very easy way to do this other than looking through the hl-line source code and adding that to highlight the current match in swiper. Maybe you can create an issue on the swiper github?
    – Jules
    Mar 7 '16 at 15:17

You probably want:

(setq ivy-format-function 'ivy-format-function-line)
  • I added a gif to best demonstrate what I am referring to. See how hl-line highlight current line (where point is), as opposed to how swiper highlight current candidate. I am unable to reproduce hl-line's appearance with (set-face-attribute 'ivy-current-match nil :background foo). Mar 8 '16 at 16:12
  • Nevermind, got it to work with latest swiper. Thanks :) Mar 8 '16 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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