9

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?

Nick
  • 4,423
  • 4
  • 24
  • 41
  • 3
    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 02:50
  • 1
    @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 05:25
  • @Malabarba -- thank you, I wasn't aware it defaults to all faces present at point. – lawlist Dec 27 '14 at 06:47
  • 1
    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 09 '20 at 10:09

1 Answers1

10

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.

erikstokes
  • 12,686
  • 2
  • 34
  • 56
  • 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 09: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