【发布时间】:2011-05-28 13:56:18
【问题描述】:
Emacs 的 hl-line-mode 正是我所需要的,但我想改变它可怕的黄色,有人知道我该怎么做吗?
【问题讨论】:
标签: colors emacs line text-cursor
Emacs 的 hl-line-mode 正是我所需要的,但我想改变它可怕的黄色,有人知道我该怎么做吗?
【问题讨论】:
标签: colors emacs line text-cursor
我使用(set-face-background hl-line-face "gray13")。
这是黑色背景下的样子。
非常微妙。大多数情况下,我在移动光标时会注意到它,这正是我想要的。
如果您想查看所有不同颜色的显示,请尝试(list-colors-display)。它将在新缓冲区中显示颜色列表。
编辑:呵呵,因为我得到了漂亮照片的投票, 这里是“现场”:
(ps:那个动图是用Cropper tool和AnimatedGif plugin制作的。)
【讨论】:
hl-line-face 变量看起来确实是'hl-line 的适当间接)
hl-line-face 是面对面的首选方式。我想。
(set-face-background 'hl-line "gray13") 放在顶层会导致Invalid face 错误,但是当您在加载 hl-line-mode 之后拥有它时,它工作得很好。
M-x list-colors-display:D
M-x customize-group RET hl-line RET
并修改“Hl Line face”。
或者,您可以使用(例如):
(set-face-background 'hl-line "#333333")
编辑:对于第二个版本来说,cheeso 的答案将是更强大的方法。
【讨论】:
除了所有不错的答案之外,您还可以使用use-package 进行如下操作:
(use-package hl-line
:custom-face
(hl-line ((t (:background "#aaaaaa")))))
hl-line是根据the author of hl-line+在Emacs 22中添加的可自定义面。
【讨论】: