我正在运行Emacs,在C++模式和PHP模式下编辑文件.我喜欢语法高亮作为一个概念,但默认颜色是一个讽刺.我几乎看不到其中的一些:太黑了.改变价值观的最简单方法是什么?我似乎无法在网上找到任何相关信息.我甚至不介意更改二进制文件,因为我正在编译自己的Emacs.我只想找到蓝色为#0000FF的地方,并将其更改为#AAAAFF.
我觉得最简单的方法就是使用颜色主题.
https://www.emacswiki.org/emacs/ColorThemes
但如果您不想这样做,请将光标放在有问题的文本上,然后点击M-x customize-face
.它应默认为光标所在的面.
http://www.gnu.org/software/emacs/manual/html_node/emacs/Specific-Customization.html
2种方法 - 你可以安装包颜色主题,它有很多很好的方案可供选择,更容易手工完成.副手看起来像这样(在你的.emacs中)
(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"))))
...
等等
你也可以输入
`M-x customize-face RET`
这将为您提供所有自定义设置,最终以您的.emacs结束.
将光标放在要更改的面("颜色")上.命中C-u C-x =.这将告诉您哪个面在该位置,并且它将让您单击以自定义它们/它们.保存您的自定义.