xuinkrbin.
xuinkrbin.

Reputation: 1015

How to set default emacs background and foreground colors?

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.]

Upvotes: 31

Views: 47827

Answers (3)

aartist
aartist

Reputation: 3236

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

Upvotes: 5

Lokesh A. R.
Lokesh A. R.

Reputation: 2366

Another excellent method of color implementation for is available here:

http://homepages.inf.ed.ac.uk/s0243221/emacs/

I found it convenient to call the colors by names rather than the HEX codes.

Upvotes: 0

Alp
Alp

Reputation: 2826

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.

Upvotes: 41

Related Questions