mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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)))
|
||||
|
Reference in New Issue
Block a user