super_momonga · 2022-05-25 12:39
im a emacs noob and i want to use the rainbow-mode on doom emacs to highlight columms of colors. When i launch the command (rainbow-color) it shows it, but only in that specific file and not others, and everytime i open doom emacs, i have to launch again the command
how can i do that a module always starts?, be consistent?. Thanks
dargscisyhp · 2022-05-25 15:43
This might not be the ideal way to do it, but you could try something like the following in your config.el
(add-hook 'buffer-list-update-hook 'rainbow-mode)
LemonBreezes · 2022-05-25 15:50
You can also do `(add-hook! (prog-mode-hook text-mode-hook) #'rainbow-mode)` though I do not recommend this as `rainbow-mode` can produce a lot of overlays and slow your Emacs to a crawl. Instead, I recommend enabling it on a per-file or per-directory basis.
Kefim_Wod · 2022-05-25 15:50
I use doom and this is what I have in my config.
(add-hook! org-mode 'rainbow-mode)
(add-hook! prog-mode 'rainbow-mode)
It will hook rainbow-mode into any programming language mode and org-mode which covers most use cases.
Kefim_Wod · 2022-05-25 15:53
This could work but I haven't tested it.
TIL `buffer-list-update-hook` so that's neat.
pwnedary · 2022-05-25 17:30
See also `evil-local-mode-hook` that can be very convenient.
super_momonga · 2022-05-25 19:03
it wordked, thanks a lot bro
super_momonga · 2022-05-25 19:03
thanks for the reply man
super_momonga · 2022-05-25 19:03
solved, thanks man