Emacs personal configuration
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

76 Zeilen
2.7KB

  1. (when (< emacs-major-version 24)
  2. (require-package 'color-theme))
  3. (require-package 'color-theme-sanityinc-solarized)
  4. (require-package 'color-theme-sanityinc-tomorrow)
  5. ;;------------------------------------------------------------------------------
  6. ;; Old-style color theming support (via color-theme.el)
  7. ;;------------------------------------------------------------------------------
  8. (defcustom window-system-color-theme 'color-theme-sanityinc-solarized-dark
  9. "Color theme to use in window-system frames.
  10. If Emacs' native theme support is available, this setting is
  11. ignored: use `custom-enabled-themes' instead."
  12. :type 'symbol)
  13. (defcustom tty-color-theme 'color-theme-terminal
  14. "Color theme to use in TTY frames.
  15. If Emacs' native theme support is available, this setting is
  16. ignored: use `custom-enabled-themes' instead."
  17. :type 'symbol)
  18. (unless (boundp 'custom-enabled-themes)
  19. (defun color-theme-terminal ()
  20. (interactive)
  21. (color-theme-sanityinc-solarized-dark))
  22. (defun apply-best-color-theme-for-frame-type (frame)
  23. (with-selected-frame frame
  24. (funcall (if window-system
  25. window-system-color-theme
  26. tty-color-theme))))
  27. (defun reapply-color-themes ()
  28. (interactive)
  29. (mapcar 'apply-best-color-theme-for-frame-type (frame-list)))
  30. (set-variable 'color-theme-is-global nil)
  31. (add-hook 'after-make-frame-functions 'apply-best-color-theme-for-frame-type)
  32. (add-hook 'after-init-hook 'reapply-color-themes)
  33. (apply-best-color-theme-for-frame-type (selected-frame)))
  34. ;;------------------------------------------------------------------------------
  35. ;; New-style theme support, in which per-frame theming is not possible
  36. ;;------------------------------------------------------------------------------
  37. ;; If you don't customize it, this is the theme you get.
  38. (setq-default custom-enabled-themes '(sanityinc-solarized-light))
  39. ;; Ensure that themes will be applied even if they have not been customized
  40. (defun reapply-themes ()
  41. "Forcibly load the themes listed in `custom-enabled-themes'."
  42. (dolist (theme custom-enabled-themes)
  43. (unless (custom-theme-p theme)
  44. (load-theme theme)))
  45. (custom-set-variables `(custom-enabled-themes (quote ,custom-enabled-themes))))
  46. (add-hook 'after-init-hook 'reapply-themes)
  47. ;;------------------------------------------------------------------------------
  48. ;; Toggle between light and dark
  49. ;;------------------------------------------------------------------------------
  50. (defun light ()
  51. "Activate a light color theme."
  52. (interactive)
  53. (color-theme-sanityinc-solarized-light))
  54. (defun dark ()
  55. "Activate a dark color theme."
  56. (interactive)
  57. (color-theme-sanityinc-solarized-dark))
  58. (provide 'init-themes)