ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial
Web Hosting by 1&1

Emacs: Playing with Color Theme

Xah Lee,

This page is some tips on setting up color themes for emacs.

emacs color theme misterioso 2012-10-12-2
emacs color theme misterioso

Simple Pale Background

This is a very simple setup, to put background color to a pale tinge. Call set-background-color then type “honeydew”.

Call list-colors-display to see available colors.

For permanent setup, put the following in your emacs init file.

;; set background to pale tinge
(set-background-color "honeydew")

(setq initial-frame-alist '((width . 100) (height . 54)))
(setq default-frame-alist
      '((menu-bar-lines . 1)
        (left-fringe)
        (right-fringe)
        (tool-bar-lines . 0)
        (width . 100)
        (height . 52)
        ))

(set-frame-parameter nil 'font "DejaVu Sans Mono-10")

The DejaVu font is the best font for Unicode. It's installed on Linux. On Windows or Mac, you might want to try it, or remove the line. 〔☛ Best Unicode Fonts for Programing

Simple White on Black, Reverse Video

Sometimes, under bright sunlight, it's better to have black background. You can start emacs with emacs -rv.

Emacs 24 load-theme

Emacs 24 comes with color themes. To activate, call load-theme, then press Tab ↹ to show a list of available themes.

adwaita
deeper-blue
dichromacy
light-blue
manoj-dark
misterioso
tango
tango-dark
tsdh-dark
tsdh-light
wheatgrass
whiteboard
wombat

For perm setting, put this in your emacs init file.

(load-theme 'misterioso)

Using color-theme package

For more elaborate color themes, you can install the package “color-theme”.

In emacs 24, call list-packages. Search for “color-theme”. (If you don't see it, you need to add MELPA repository. See: A Guide on Emacs 24 Package System.) Press 【i】 to mark for install. 【x】 to install. Call describe-modeF1 m】 to see a list of keys.

Then, call color-theme-select. It'll list themes. Move cursor and press Enter ↵ to apply. (you can also call describe-variableF1 v】 then “color-themes” to see a list of available themes. For example, one of them is color-theme-classic. These are elisp commands.)

To make it permanent, you can set in your emacs init this:

(package-initialize)
(require 'color-theme)
(setq color-theme-is-global t)
(color-theme-initialize)
(color-theme-classic)

Thanks to Gabriel Saldaña, Torsten Wagner for tip.

blog comments powered by Disqus