I would like to turn on rainbow-mode in elisp and/or lisp modes when I am editing init.el
using use-package
. I've tried the following:
(use-package rainbow-mode
:demand t
:hook
((text-mode . rainbow-mode)
(elisp-mode . rainbow-mode)
(lisp-mode . rainbow-mode)))
I've also tried attacking it from the other side and attaching it to the lisp/elisp mode definition
(use-package lisp-mode
:ensure nil
:hook
(lisp-mode . rainbow-mode))
And I also tried using a setup method:
(use-package elisp-mode
:ensure nil
:hook
(elisp-mode . lisp-mode-setup))
But it doesn't seem to work. I can turn it on manually in the buffer by calling M-x rainbow-mode
but I can't get use-package
to play ball. I'm basically trying to find a way to add code to a mode hook.
What am I missing? Should I do this a different way? Am I hooking into the correct mode?