(Not really python specific)
Emacs.reddit recently had two posts dealing with emacs color themes. Coincidentally, I had just installed color-theme last Friday and was playing around with it. I was getting sick of black on white. Sadly, I really didn't like a lot of the pre-installed themes with color-theme. Some of them change your fonts (which color-theme says not to do, though it is cool to see comments in non-mono spaced fonts), others just appear to try and provide the most shock values (or contrast). Another thing I wanted was bold keywords (just so they would visually be distinct from non keywords). So combining my two requirements, easy to look at, and bold keywords left me in somewhat of a pickle. Until I found this nice theme based on tango. (Tango is a set of icons and color guidelines for freedesktops.)
I just added the definition for the tango theme directly to my .emacs. (I should probably start to break this stuff up like the emacs starter kit (which sadly ignores the existence of python, ruby snobs...)). I guess it's good that my theme is somewhere where I manage, rather than crammed in with the others in the the color-theme file. Then I can tweak it if I feel so. All is well and good, until I start emacs in a terminal, which only support 256 colors... So I default to a TTY friendly theme while running in a console.
;; color theme (requires http://www.emacswiki.org/cgi-bin/wiki?ColorTheme )
(require 'color-theme)
(color-theme-initialize)
;;
(if window-system
(color-theme-tango))
(if (not (window-system))
(color-theme-tty-dark))
update - Tools like ecb can make your nicely tweaked color theme, look like lipstick on a pig. Use M-x list-faces-display to find the offending faces. Update them in your config as needed.
update - Here's the font/color theme I'm currently using. I'm still tweaking, but it's a start...
;; the following is size 7 for me...
(set-face-font 'default "-unknown-Envy Code R-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1")
;;(set-default-font "Envy Code R-7") ;; doesn't work consistently ;(
;;; Color theme based on Tango Palette. Created by danranx@gmail.com
;;; http://www.emacswiki.org/cgi-bin/emacs/color-theme-tango.el
(defun color-theme-tango ()
"A color theme based on Tango Palette."
(interactive)
(color-theme-install
'(color-theme-tango
((background-color . "#2e3436")
(background-mode . dark)
(border-color . "#888a85")
(cursor-color . "#fce94f")
(foreground-color . "#eeeeec")
(mouse-color . "#8ae234"))
((help-highlight-face . underline)
(ibuffer-dired-buffer-face . font-lock-function-name-face)
(ibuffer-help-buffer-face . font-lock-comment-face)
(ibuffer-hidden-buffer-face . font-lock-warning-face)
(ibuffer-occur-match-face . font-lock-warning-face)
(ibuffer-read-only-buffer-face . font-lock-type-face)
(ibuffer-special-buffer-face . font-lock-keyword-face)
(ibuffer-title-face . font-lock-type-face))
(border ((t (:background "#888a85"))))
(fringe ((t (:background "grey10"))))
(mode-line ((t (:foreground "#eeeeec" :background "#555753"))))
(region ((t (:background "#555753"))))
(font-lock-builtin-face ((t (:foreground "#729fcf"))))
(font-lock-comment-face ((t (:foreground "#888a85"))))
(font-lock-constant-face ((t (:foreground "#8ae234"))))
(font-lock-doc-face ((t (:foreground "#888a85"))))
(font-lock-keyword-face ((t (:foreground "#729fcf" :bold t))))
;; remove italic from strings
(font-lock-string-face ((t (:foreground "#ad7fa8"))))
(font-lock-type-face ((t (:foreground "#8ae234" :bold t))))
(font-lock-variable-name-face ((t (:foreground "#eeeeec"))))
(font-lock-warning-face ((t (:bold t :foreground "#f57900"))))
(font-lock-function-name-face ((t (:foreground "#edd400" :bold t :italic t))))
;; ECB - matt added
;; see - http://ecb.sourceforge.net/docs/ecb-faces.html
(ecb-default-highlight-face((t (:background "#75507b"))))
;; end ecb
(comint-highlight-input ((t (:italic t :bold t))))
(comint-highlight-prompt ((t (:foreground "#8ae234"))))
(isearch ((t (:background "#f57900" :foreground "#2e3436"))))
(isearch-lazy-highlight-face ((t (:foreground "#2e3436" :background "#e9b96e"))))
(show-paren-match-face ((t (:foreground "#2e3436" :background "#73d216"))))
(show-paren-mismatch-face ((t (:background "#ad7fa8" :foreground "#2e3436"))))
(minibuffer-prompt ((t (:foreground "#729fcf" :bold t))))
(info-xref ((t (:foreground "#729fcf"))))
(info-xref-visited ((t (:foreground "#ad7fa8"))))
)))
;; color theme (requires http://www.emacswiki.org/cgi-bin/wiki?ColorTheme )
(require 'color-theme)
;;
(if window-system
(color-theme-tango))
(if (not (window-system))
(color-theme-tty-dark))
<borat>Very niiice</borat>
If you want to change a built in color theme, do M-x color-theme-select
then highlight the theme you wish to use as a starting point and hit p.
This will invoke the color-theme-print function which will print the color
theme to a buffer which you can then change. To preview the built in emacs
colors, do M-x list-colors-display. To preview your theme just hit C-c v
in the buffer to execute it. Once you're finished C-x C-w to save it
somewhere and then load it in your init.el. You now no longer need to load
color-theme.el at all. It only took me a few minutes to adjust one of the
existing themes to my liking...and funnily enough, it's actually pretty
close to your one
I really like this color theme. I used Zenburn color theme I found
somewhere I don't remember, but I like this one much better.
Thanks for sharing good information. :-)