Emacs' hl-line-mode is just what i need but i would like to change it's horrible yellow color, anyone know how can i do that?
I use (set-face-background hl-line-face "gray13")
.
here's what it looks like with a black background.
Very subtle. Mostly I notice it when moving the cursor, which is what I wanted.
If you want to see a display of all the various colors, try (list-colors-display)
. It will show a list of colors in a new buffer.
EDIT: heh heh, since I am getting upvoted for pretty pictures, here it is "live":
(ps: that animated gif was produced with the Cropper tool and the AnimatedGif plugin.)
-
-
1Do not be seduced by the pretty pictures! Revel in the text-only goodness, just over there (points) (although the
hl-line-face
variable does looks like appropriate indirection for'hl-line
) – phils Dec 23 '10 at 20:26 -
@phils - I think I read somewhere that
hl-line-face
was the preferred way to get to the face. I think. – Cheeso Dec 24 '10 at 0:14 -
Yeah, I would say the fact that it exists is probably sufficient evidence of that :) It seems highly unlikely that it would ever make a difference, mind, but I've changed my own config accordingly. – phils Dec 24 '10 at 8:52
-
4You probably made it an after advice because having the
(set-face-background 'hl-line "gray13")
on top level results in anInvalid face
error, but when you have it after the hl-line-mode has been loaded, then it works just fine. – hvrauhal Nov 5 '13 at 11:37
M-x customize-group
RET hl-line
RET
and modify "Hl Line face".
Alternatively, you could use (for example):
(set-face-background 'hl-line "#333333")
edit: cheeso's answer would be the more robust approach for that second version.