Changing highlight line color in emacs

别说谁变了你拦得住时间么 提交于 2019-12-20 08:57:31

问题


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.

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.


回答1:


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)



回答2:


M-x customize-face RET hl-line will help you. Just pick a face you like (you can type the same command with the other theme installed, just to peek the values you like).



来源:https://stackoverflow.com/questions/17701576/changing-highlight-line-color-in-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!