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
    Commented Mar 7, 2016 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. Commented Mar 7, 2016 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
    Commented Mar 7, 2016 at 15:17

1 Answer 1


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). Commented Mar 8, 2016 at 16:12
  • Nevermind, got it to work with latest swiper. Thanks :) Commented Mar 8, 2016 at 16:15

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.