Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun my-set-theme-on-mode ()
- (let* ((mode (cond
- ((memq major-mode '(clojure-mode clojurescript-mode))
- 'zenburn)
- ((memq major-mode '(elisp-mode emacs-lisp-mode))
- 'dracula)
- ((memq major-mode '(python-mode octave-mode))
- 'solarized-dark)
- ((memq major-mode '(org-mode))
- 'nord))))
- (when mode
- (load-theme mode))))
- (defadvice switch-to-buffer (after activate)
- (when buffer-file-name (my-set-theme-on-mode)))
- (defadvice other-window (after other-window-now activate)
- (when buffer-file-name (my-set-theme-on-mode)))
- (defadvice other-frame (after other-frame-now activate)
- (when buffer-file-name (my-set-theme-on-mode)))
- (add-hook 'after-change-major-mode-hook 'my-set-theme-on-mode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement