[ACCEPTED]-emacs equivalent of vim's bg=dark? (setting background to dark)-emacs

Accepted answer
Score: 15

I've used the invert-face function in the past:

(invert-face 'default)

Or:

M-x invert-face <RET> default

0

Score: 8

I think the best approach to use is to use 4 ColorTheme. Other options to customize the frame colors 3 you can find here. I can't think about a single 2 command, however you can start emacs with 1 --reverse-video.

Score: 7

M-x set-variable <RET> frame-background-mode <RET> dark

see also the bottom of https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html

0

Score: 2

Write this at the end of your ~/.emacs file :

;; dark mode
(when (display-graphic-p)
  (invert-face 'default)
)
(set-variable 'frame-background-mode 'dark)

Note: The 3 "when" sentence is there to avoid 2 to invert colors in no-window mode (I presume 1 your terminal has already a black background).

Score: 1

The alect-themes package for Emacs 24 provides light, dark, and 6 black themes, and can be installed either 5 manually or using MELPA.

To install alect-themes using MELPA 4 and select alect-dark (from ~/emacs.d/init.d):

(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list 'package-archives
           '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
  (package-initialize)
  (load-theme 'alect-dark)
  )

There are quite a few 3 color theme packages in MELPA, so if alect-themes 2 doesn't meet your needs, experiment with 1 some of the others.

More Related questions