Add doom/switch-theme; a more sensible load-theme
load-theme doesn't disable previously enabled themes before switching. doom/switch-theme does. This remaps any keys bound to load-theme to doom/switch-theme.
This commit is contained in:
parent
3b4fd56cac
commit
43e0314e86
2 changed files with 24 additions and 3 deletions
|
@ -103,3 +103,20 @@ presentations."
|
|||
(mapc #'disable-theme custom-enabled-themes))
|
||||
(doom|init-theme)
|
||||
(doom|init-fonts)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/switch-theme (theme)
|
||||
"Like `load-theme', but will unload currently loaded themes before switching
|
||||
to a new one."
|
||||
(interactive
|
||||
(list (completing-read
|
||||
"Load theme: "
|
||||
(mapcar #'symbol-name
|
||||
(custom-available-themes)))))
|
||||
(condition-case nil
|
||||
(progn
|
||||
(mapc #'disable-theme custom-enabled-themes)
|
||||
(load-theme (intern theme) t)
|
||||
(when (fboundp 'powerline-reset)
|
||||
(powerline-reset)))
|
||||
(error "Problem loading theme %s" x)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue