all repos — nixfiles @ 3670531f404f2f17327676c46f9487ca60e50547

System and user configuration, managed by nix and home-manager

Emacs: Enable rainbow-mode for xmonad-type files Create a derived mode to enable specific mode hooks for such files Add hook to new mode for enabling rainbow-mode

Alan Pearce
commit

3670531f404f2f17327676c46f9487ca60e50547

parent

656d10b19d09c72b4cc14e96c7639e92493ee853

1 file changed, 11 insertions(+), 2 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -148,6 +148,12 @@ (ap/set-fonts "Consolas" "Segoe UI" 10))
((eq system-type 'darwin) (ap/set-fonts "Monaco" "Helvetica" 12)))) +(req-package rainbow-mode + :commands (rainbow-turn-on + rainbow-turn-off) + :config (progn + (add-hook 'xmonad-mode-hook #'rainbow-turn-on))) + ;;;; Autosaves & Backups (let ((backup-dir (expand-file-name "~/.emacs.d/backups/"))) (unless (file-directory-p backup-dir)
@@ -578,8 +584,11 @@ :mode (("\\.Xdefaults\\'" . xrdb-mode)
("\\.Xresources\\'" . xrdb-mode))) (req-package haskell-mode - :mode (("\\.hs\\'" . haskell-mode) - ("xmobarrc\\'" . haskell-mode))) + :mode (("\\.hs\\'" . haskell-mode))) + +(define-derived-mode xmonad-mode haskell-mode "XM") +(add-to-list 'auto-mode-alist '("xmobarrc\\'" . xmonad-mode)) +(add-to-list 'auto-mode-alist '("xmonad.hs\\'" . xmonad-mode)) (req-package nginx-mode :mode (("nginx.conf" . nginx-mode))