Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOWTO] Customize the doom-modeline #1817

Closed
benjaminbauer opened this issue Sep 23, 2019 · 4 comments
Closed

[HOWTO] Customize the doom-modeline #1817

benjaminbauer opened this issue Sep 23, 2019 · 4 comments
Labels
is:support A request for user support: questions, how-to's, and discussions module:ui/modeline Pertains to Doom's :ui modeline module re:elisp Personal configuration issues, conflicts or questions

Comments

@benjaminbauer
Copy link

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?

@thiagokokada
Copy link
Contributor

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.

@thiagokokada
Copy link
Contributor

thiagokokada commented Sep 23, 2019

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.

@hlissner
Copy link
Member

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))

@hlissner hlissner added is:support A request for user support: questions, how-to's, and discussions module:ui/modeline Pertains to Doom's :ui modeline module re:elisp Personal configuration issues, conflicts or questions labels Sep 23, 2019
@benjaminbauer
Copy link
Author

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? :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:support A request for user support: questions, how-to's, and discussions module:ui/modeline Pertains to Doom's :ui modeline module re:elisp Personal configuration issues, conflicts or questions
Projects
None yet
Development

No branches or pull requests

3 participants