diff --git a/custom.el b/custom.el index a956ec9..bd10fc6 100644 --- a/custom.el +++ b/custom.el @@ -191,14 +191,15 @@ (global-set-key (kbd "M-z") 'zap-up-to-char) ;; Binds for switching between light and dark themes. -(global-set-key [f5] (lambda () - (interactive) - (disable-theme 'basic) - (load-theme 'magik))) -(global-set-key [f6] (lambda () - (interactive) - (disable-theme 'magik) - (load-theme 'basic))) +(defmacro fez/switch-theme (new-theme) + `(lambda () + (interactive) + (disable-theme (car custom-enabled-themes)) + (enable-theme ,new-theme))) + +(global-set-key [f5] (fez/switch-theme 'magik)) +(global-set-key [f6] (fez/switch-theme 'basic)) + (add-hook 'emacs-lisp-mode-hook (lambda () (local-set-key (kbd "C-c k") #'fez/insert-keybind)))