I'm using Monokai theme. When I start helm, the current selected line are highlighted in gray. It's not easy to spot,especially with the title information in blue. Helm in Monokai theme

How can I change this gray highlight, say, in purple?

  • 2
    Place the cursor on the area you want to change and type C-u C-x = and see what faces are present. Then you can use M-x customize-face to set color under most circumstances; however, there are a few exceptions to the rule. Sometimes, more than one face will be present at the same location and this is why I recommend seeing what is there before just changing what seems like the most likely choice. – lawlist Dec 27 '14 at 2:50
  • @lawlist M-x customize-face will actually offer you the faces under point as a default. Not that there's anything wrong with checking C-x =. :-) – Malabarba Dec 27 '14 at 5:25
  • @Malabarba -- thank you, I wasn't aware it defaults to all faces present at point. – lawlist Dec 27 '14 at 6:47
  • But when you are in the helm-mini buffer, you can't actually check for the fonts in selection, because it's an active buffer, so you can't type anything. Any solutions? – Emmanuel Goldstein Dec 9 '20 at 10:09

The name of the face helm uses to highlight the selected item is helm-selection. You can change just the background color of any face with set-background-color: (set-background-color 'helm-selection "purple"). You can also useset-face-attribute like this:

(set-face-attribute 'helm-selection nil 
                    :background "purple"
                    :foreground "black")

if you also want to set other attributes at the same time.

  • Thank you for your answer. May I ask why it works well in my init.el file; while doesn't work in another file loaded in? I put these code in helm-c.el and (load "~/.emacs.d/config/helm-c.el"). It doesn't work. – Nick Dec 27 '14 at 9:30
  • You can use helm-colors to search for available faces of a package. For example, if you want to search for all Helm's faces, simply type "helm-" in the prompt of helm-colors. – Tu Do Dec 27 '14 at 11:25

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.