What I want to achieve
Not sure if this is a doom, doom-modeline or general emacs question:
I want to set the following variables:
;; doom.d/config.el
(setq
doom-modeline-buffer-encoding nil
size-indication-mode nil
column-number-mode nil
line-number-mode nil
)
This works fine, when I set the variables manually for the current buffer, but it gets overwritten, when I open another buffer.
Is there a hook I need to put this in?
At least for size-indication-mode I need to do this:
(add-hook! 'size-indication-mode-hook
(setq size-indication-mode nil))
Not sure for the rest.
Maybe this works:
(add-hook! 'column-number-mode-hook
(setq column-number-mode nil))
(add-hook! 'line-number-mode-hook
(setq line-number-mode nil))
For doom-modeline-buffer-encoding, (setq doom-modeline-buffer-encoding nil) should work.
Try this:
(after! doom-modeline
(remove-hook 'doom-modeline-mode-hook #'size-indication-mode) ; filesize in modeline
(remove-hook 'doom-modeline-mode-hook #'column-number-mode) ; cursor column in modeline
(line-number-mode -1)
(setq doom-modeline-buffer-encoding nil))
Thanks @thiagokokada and @hlissner . The latter approach worked.
Just so I can ask more informed questions in the future: What is your heuristic for such a problem? How do you work towards figuring out, that for some cases (doom-modeline-buffer-encoding) setting a variable works and for others you have to go look for a hook? And how do you go about finding the hook? :)
Most helpful comment
Try this: