更改Emacs语法突出显示颜色

我正在运行Emacs,在C ++模式和PHP模式下编辑文件。 我喜欢语法突出作为一个概念,但默认的颜色是一个滑稽。 我几乎读不懂其中的一些:太黑了。 什么是最简单的方法来改变他们的价值观? 我似乎无法在网上找到任何关于此事的信息。 我甚至不介意在编译我自己的Emacs时更改二进制文件。 我只想找到它表示蓝色是#0000FF的地方,并将其更改为#AAAAFF。


我发现最容易使用颜色主题这种事情。

https://www.emacswiki.org/emacs/ColorThemes

但如果您不想这样做,请将光标放在违规文本上,然后按Mx 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中结束。


把光标放在你想改变的面上(“颜色”)。 击中Cu Cx =。 这将告诉你哪个面孔出现在该位置,并且它会让你点击来定制它/他们。 保存您的自定义设置。

链接地址: http://www.djcxy.com/p/47095.html

上一篇: Change Emacs syntax highlighting colors

下一篇: Syntax highlighting code with Javascript