Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you apply a Emacs custom color theme in console mode?

When I load a custom color scheme (through M-x load-theme or M-x customize-theme) the results only seem to be applied when Emacs runs in a separate window:

Emacs in GUI

But when Emacs is run in a terminal with -nw, the default colors seem to be used:

Emacs in terminal
(source: raghav at www.ocf.berkeley.edu)

I'm new to Emacs, so I don't know if this is expected behavior -- but it doesn't seem to be, since Googling turns up several people discussing using color themes in console mode. Any help would be much appreciated.

like image 447
Raghav Avatar asked Apr 29 '12 18:04

Raghav


People also ask

How do I change the color of my Emacs theme?

You can enable a specific Custom theme in the current Emacs session by typing M-x load-theme . This prompts for a theme name, loads the theme from the theme file, and enables it. If a theme file has been loaded before, you can enable the theme without loading its file by typing M-x enable-theme .

How do I change the color of my theme in terminal?

Launch Windows Terminal and then select the small downward-facing arrow in the title bar. This will open a pull-down menu that lists the available profiles on your system (for example, Windows PowerShell and Command Prompt) and some other options. Select Settings, and the settings.

How do you make Emacs colorful?

Call customize-themes to set a color theme. emacs M-x customize-themes. Click to see the change immediately. Alternatively, call load-theme , then press Tab ↹ to show a list of available themes.

How do I make an Emacs theme?

You can define a Custom theme using an interface similar to the customization buffer, by typing M-x customize-create-theme . This switches to a buffer named *Custom Theme* . It also offers to insert some common Emacs faces into the theme (a convenience, since Custom themes are often used to customize faces).


2 Answers

See this question: How to make Emacs terminal colors the same as Emacs GUI colors?

The theme in your console looks quite close to the one in the GUI, so my bet is that you will have to live with it -- or use the GUI.

like image 78
bzg Avatar answered Oct 05 '22 05:10

bzg


I am very late, but I had the same problem and I solved it adding the following line to my ~/.zshrc

export TERM=xterm-256color

If you are not using zsh (for example you are using bash), you must add it on your right console init file (for example ~/.bashrc)

like image 45
Pedro José Piquero Plaza Avatar answered Oct 05 '22 07:10

Pedro José Piquero Plaza