Emacs syntax highlighting color change

I run Emacs by editing files in C ++ mode and PHP mode. I like syntax highlighting as a concept, but the default color is a parody. I can hardly read some of them: too dark. What is the easiest way to change your values? I can not find anything about this on the Internet. I don't even mind modifying the binary as I compose my own Emacs. I just want to find the place where it says, the blue color is # 0000FF and, for example, change it to #AAAAFF.

+50
colors emacs syntax-highlighting
Jul 02 '09 at 20:23
source share
4 answers

It’s easiest for me to use a color theme for this kind of thing.

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

But if you do not want to do this, move the cursor over the disturbing text, press Mx customize-face . It should by default cover the face with the cursor.

http://www.gnu.org/software/emacs/manual/html_node/emacs/Specific-Customization.html

+60
Jul 02 '09 at 20:25
source share

2 ways - you can install the color theme of the package, in which there are many good schemes for choosing and it is easier to do it manually. It looks like this (in your .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")))) 

...

etc .. and others.

You can also enter

 `Mx customize-face RET` 

which will provide you with all the settings for the installation will end up in your .emacs.

+24
Jul 02 '09 at 20:29
source share

Place the cursor on the face (“color”) that you want to change. Press Cu Cx = . This will tell you which persons are present in this position, and this will allow you to click to customize him / them. Save the settings.

+12
Sep 05 2018-11-11T00: 00Z
source share

If you don't care about color highlighting at all, or none of the above answers work for you (or too much time and effort to figure out), here is a very simple solution that will completely get rid of colors,

By entering the following, you will get rid of the flowers:

Mx global-font-lock-mode

You can also do this as an intermediate step so that you can see everything on your screen to try any of the answers above. In my case, it was very useful, because the color of some key pieces of text that would allow me to change colors was almost invisible - for example, the Mx prompt.

If you want the changes to be permanent, you can add this to your .emacs file:

(setq-default global-font-lock-mode nil)

+1
Aug 04 '16 at 18:21
source share



All Articles