Heaven and Hell - emacs package for easy toggling of light/dark color themes.
I constantly switch light and dark theme. When it's sunny outside, or I work in a very light room - I use the light theme. Otherwise, I prefer dark one. So I wrote a bunch of helpers which helped me with this and one day I decided to make a package out of it. Hope it'll be useful to anybody else. Cheers!
- Define your favorite light and dark themes
- Choose which one to run by default
- Switch between them with a single keypress
- Easily roll back to default emacs theme in case of messed faces
heaven-and-hell is available in Melpa.
use-package (including example config):
(use-package heaven-and-hell :ensure t :init (setq heaven-and-hell-theme-type 'dark) ;; Omit to use light by default (setq heaven-and-hell-themes '((light . tsdh-light) (dark . tsdh-dark))) ;; Themes can be the list: (dark . (tsdh-dark wombat)) :hook (after-init . heaven-and-hell-init-hook) :bind (("C-c <f6>" . heaven-and-hell-load-default-theme) ("<f6>" . heaven-and-hell-toggle-theme)))
First clone the repo:
git clone https://github.com/valignatev/heaven-and-hell.git your/site/elisp/path
Then add this in your
(require 'heaven-and-hell "your/site/elisp/path/heaven-and-hell/heaven-and-hell.el")
use-package configuration look above in installation section
;; Default is 'light (setq heaven-and-hell-theme-type 'dark) ;; Set preferred light and dark themes ;; default light is emacs default theme, default dark is wombat ;; Themes can be the list: (dark . (tsdh-dark tango-dark)) (setq heaven-and-hell-themes '((light . tsdh-light) (dark . tsdh-dark))) ;; Add init-hook so heaven-and-hell can load your theme (add-hook 'after-init-hook 'heaven-and-hell-init-hook) ;; Set keys to toggle theme and return to default emacs theme (global-set-key (kbd "C-c <f6>") 'heaven-and-hell-load-default-theme) (global-set-key (kbd "<f6>") 'heaven-and-hell-toggle-theme)
Have trouble with installation? Found a bug? Want a new feature? Feel free to open an issue!
Want to fix a bug or add something new yourself? Feel free to submit pull request!
Also, don't hesitate to share it anywhere in the Internet :)