Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing highlight line color in emacs

I installed emacs 24 and also installed prelude and I wanted to change the theme from zenburn to tango-dark. But the color that the line is highlighted is yellow and I don't like that. I want it to be like the gray color in zenburn. tango-dark theme with hl-line enabled(yellow)

zenburn theme with hl-line enabled(dark gray)

What should I do? I prefer not to turn off the hl-line but when I tried that I saw that the space between parentheses () are highlighted with the same yellow color. (In zenburn theme that didn't happen). I also know that this is not part of the tango theme because when I run vanilla emacs(sudo emacs) with tango theme no such highlighting happens. tango-dark theme with hl-mode disabledvanilla emacs with tango-dark theme

like image 390
Farzam Avatar asked Jul 17 '13 13:07

Farzam


People also ask

How do I change the highlight color in emacs?

To customize colors for color syntax highlighting, see the section on font-lock . To change the foreground or background color in Emacs through the windowing interface, you can use the menu commands Foreground Color->Other and Background Color->Other in the Edit->Text Properties menu.


1 Answers

That would be an easy fix if you customize your init file (~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el)

Turn on hl-line:

(global-hl-line-mode 1) 

Set any color as the background face of the current line:

(set-face-background 'hl-line "#3e4446") 

To keep syntax highlighting in the current line:

(set-face-foreground 'highlight nil) 
like image 78
soimort Avatar answered Sep 23 '22 22:09

soimort