Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set default emacs background and foreground colors?

Tags:

emacs

In My .emacs file, I have the following:

(set-foreground-color "#E0DFDB")
(set-background-color "#102372")

When I start up emacs, the color scheme for the default emacs window is correct but all new windows start with the default color scheme of white back grounds and black foreground. Can Anyone point Me in the direction of how to get emacs to set My preferred color scheme in all new windows? [Note: If I do M-x load-file ~/.emacs after opening a new window, the colors are set the way I want but doing so manually every time I want to open a new window is distracting/annoying.]

like image 536
xuinkrbin. Avatar asked Jul 10 '12 17:07

xuinkrbin.


People also ask

What is the default color of foreground?

The foreground controls what color your brush or pencil will be, while the background color erases any added color and replaces it with the background color, which is white by default.


2 Answers

Add the following to your .emacs:

(add-to-list 'default-frame-alist '(foreground-color . "#E0DFDB")) (add-to-list 'default-frame-alist '(background-color . "#102372")) 

You might want to look at http://www.emacswiki.org/emacs/FrameParameters and the links therein.

like image 195
Alp Avatar answered Oct 17 '22 07:10

Alp


Welcome to emacs. Use Color themes to better suit your environment. https://www.emacswiki.org/emacs/ColorThemes

like image 34
aartist Avatar answered Oct 17 '22 07:10

aartist