Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install emacs colortheme

Tags:

I found this website and downloaded the color-theme files. It says:

Put the file color-theme.el and the folder “themes” (with the files color-theme-example.el and color-theme-library.el) in a directory on your LoadPath.

and then I checked the load path website, which says:

To add a single directory to the load-path:

(add-to-list 'load-path "~/.emacs.d/site-lisp/") 

My question is, where do I type this line? If I do M-x and then type, it complains add-to-list[No match].

By the way, I am using Emacs 23.2(9.0) on Mac, a GUI version. For the text version on terminal, I use black background seems fine, except the blue is too dark on black

like image 933
Alfred Zhong Avatar asked May 12 '11 18:05

Alfred Zhong


People also ask

How do I install an 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 enable Dark Mode in Emacs?

Alt + x load-theme , then press Tab to show a list of available themes. Alternatively, Alt + x customize-themes to set a color theme.

How do I change the default theme in Emacs?

Default Themes of Emacs For users that do not want to get into the hassle of changing their initialization file, they can simply add one of these default themes to their Emacs. Users can check the default themes of Emacs by pressing Alt + x and entering customize-themes.

How do I change colors in Emacs?

To change the foreground or background color in Emacs through the windowing interface, you can use the menu commands Foreground Color->Other and Background Color->Other in the Edit->Text Properties menu.


1 Answers

An answer for newbs like me!

In Emacs 24.5.1, on mac or linux the following will work.

The following command will create a folder called themes inside your .emacs.d folder (assuming one does not already exist)

mkdir ~/.emacs.d/themes/ 

Now tell emacs that you have installed a themes folder. In emacs open your .emacs file, by typing the following:

C-x C-f ;;;this opens a new .emacs file or creates one if it doesn't exist 

Add the following line to your .emacs file:

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")  

Now copy your theme's '.el' file to your .emacs.d/themes/ directory. A good place to find custom themes is here: emacsthemes.com

Now load your custom theme by typing the following:

M-x customize-themes ;;;now press return 

Your newly installed themes should appear on the list like so:

emacs *Custom Themes* buffer

Move your cursor to within the '[ ]' and press return to select that theme.

Enjoy emacs!

like image 112
Tony Cronin Avatar answered Sep 20 '22 05:09

Tony Cronin