Add keybindings to switch between themes for day and night.

This commit is contained in:
syl20bnr 2013-04-15 11:12:39 -04:00
parent 5b690b24ed
commit 19f8527a5d
4 changed files with 31 additions and 12 deletions

22
init.el
View File

@ -32,12 +32,18 @@
(add-to-list 'load-path user-emacs-directory)
(add-to-list 'load-path user-extensions-directory)
;; Emacs built-ins configuration ==============================================
(progn (when (file-exists-p user-config-directory)
(dolist (l (directory-files user-config-directory nil "^[^#].*el$"))
(load (concat user-config-directory l)))))
(defun load-user-config ()
(progn (when (file-exists-p user-config-directory)
(dolist (l (directory-files user-config-directory nil "^[^#].*el$"))
(load (concat user-config-directory l))))))
(defun load-host-config ()
(progn (when (file-exists-p host-directory)
(dolist (l (directory-files host-directory nil "^[^#].*el$"))
(load (concat host-directory l))))))
;; Setup ======================================================================
(load-user-config)
(require 'my-funcs)
(require 'my-macros)
(require 'pre-extensions)
@ -45,11 +51,7 @@
(require 'post-extensions)
(require 'my-keybindings)
(require 'my-keychords)
(load-host-config)
;; Host specific configuration ================================================
(progn (when (file-exists-p host-directory)
(dolist (l (directory-files host-directory nil "^[^#].*el$"))
(load (concat host-directory l)))))
;; Customization settings =====================================================
;; Customized settings =====================================================
(require 'custom-settings)

View File

@ -159,3 +159,18 @@ argument takes the kindows rotate backwards."
(buffer-name))))
(provide 'my-funcs)
;; Theme management
;; from http://stackoverflow.com/questions/9900232/changing-color-themes-emacs-24-order-matters
(defadvice load-theme
(before theme-dont-propagate activate)
(mapcar #'disable-theme custom-enabled-themes)
(load-user-config)
(load-host-config))
(defun load-theme-day ()
(interactive)
(load-theme 'solarized-light))
(defun load-theme-night ()
(interactive)
(load-theme 'solarized-dark))

View File

@ -140,6 +140,8 @@
(evil-leader/set-key "tf" 'fringe-mode)
(evil-leader/set-key "th" 'auto-highlight-symbol-mode)
(evil-leader/set-key "tn" 'global-linum-mode)
(evil-leader/set-key "ttd" 'load-theme-day)
(evil-leader/set-key "ttn" 'load-theme-night)
;; selection ------------------------------------------------------------------
(evil-leader/set-key "v" 'er/expand-region)
;; window ---------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")
;; ("marmalade" . "http://marmalade-repo.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")
("technomancy" . "http://repo.technomancy.us/emacs/")))
(package-initialize)
@ -53,7 +53,7 @@
nose
org
p4
;; paredit
paredit
powerline
popup
projectile