我正在运行 Emacs,并在 C++ 模式和 PHP 模式下编辑文件。 我喜欢语法高亮的概念,但默认颜色实在令人难以忍受。 有些颜色太暗了,很难辨认。 有没有最简单的方法可以更改它们的值? 在网上似乎找不到任何关于这个问题的信息。 我甚至不介意更改二进制文件,因为我正在编译自己的 Emacs。 我只想找到说蓝色是 #0000FF 的位置,并将其更改为例如 #AAAAFF。
我正在运行 Emacs,并在 C++ 模式和 PHP 模式下编辑文件。 我喜欢语法高亮的概念,但默认颜色实在令人难以忍受。 有些颜色太暗了,很难辨认。 有没有最简单的方法可以更改它们的值? 在网上似乎找不到任何关于这个问题的信息。 我甚至不介意更改二进制文件,因为我正在编译自己的 Emacs。 我只想找到说蓝色是 #0000FF 的位置,并将其更改为例如 #AAAAFF。
我发现在这种情况下,使用color-theme最容易了。
但如果你不想这样做,把光标放在问题文本上,然后按M-x customize-face
,它应该默认为光标所在的字体。
请参阅49.1.6定制特定项目。
(custom-set-faces
custom-set-faces was added by Custom.
If you edit it by hand, you could mess it up, so be careful.
Your init file should contain only one such instance.
If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "lightyellow2" :foreground "gray20" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :width normal :family "liberation mono"))))
'(background "blue")
'(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise"))))
'(font-lock-comment-face ((t (:foreground "MediumAquamarine"))))
'(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid"))))
'(font-lock-doc-string-face ((t (:foreground "green2"))))
'(font-lock-function-name-face ((t (:foreground "SkyBlue"))))
'(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue"))))
'(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue"))))
'(font-lock-reference-face ((t (:foreground "DodgerBlue"))))
'(font-lock-string-face ((t (:foreground "LimeGreen"))))
...
etc. etc.
You can also type
`M-x customize-face RET`
这将为您提供所有自定义设置,最终会在您的.emacs文件中结束。
emacs -Q
启动Emacs。如果您能够阅读文本,则应该能够看到用于定义您正在自定义的面的属性的复选框。单击链接“显示所有属性”以显示所有属性。根据需要选中或取消选中任何属性。当您选中一个框时,您将看到其当前值。如果选中了“背景”或“前景”属性,则可以使用旁边的“选择”按钮选择该属性的不同颜色。 - DrewM-x customize-themes
来选择一个颜色主题。
M-x customize-face
时,它显示的文本就是这种颜色!(此外,似乎ColorTheme链接存在问题) - MichaelM-x customize-face
默认为hl-line
,那是因为它标记了活动行的高亮线。要获取“有问题”的文本的真实面貌,请执行M-x global-hl-line-mode
以临时禁用高亮线。 - rgtk