Hide branch from modeline?
Asked Answered
L

4

6

Magit is eating up a lot of my modeline to display the current git branch ... or at least I think it's magit that's doing so, honestly I can't find any way to tell where it's coming from. I can always find that out other ways and it's pushing out other stuff I would rather have in my modeline (namely which-function-mode).

Is there any way to disable this? I don't see anything relevant in the customize menu or in the magit manual.

Lotz answered 22/12, 2014 at 17:27 Comment(0)
L
7

I did finally stumble onto the customizable variable mode-line-format I just moved (vc-mode vc-mode) from the middle to the right and now it's out of my way!

Lotz answered 22/12, 2014 at 18:3 Comment(0)
T
3

It's not Magit that's putting the branch in the mode line, but vc-git, more specifically the function vc-git-mode-line-string. I can't see any way to customize it, so the only way to remove the branch name from the mode line is to redefine or advice this function.

For example:

(advice-add 'vc-git-mode-line-string
            :override (lambda (file) ""))
Tripterous answered 22/12, 2014 at 17:45 Comment(1)
Or remove (vc-mode vc-mode) entirely from mode-line-format.Crispa
R
0
(setcdr (assq 'vc-mode mode-line-format)
        '((:eval (replace-regexp-in-string "^ Git.*$" " " vc-mode))))

https://emacs.stackexchange.com/questions/10955/customize-vc-mode-appearance-in-mode-line

Remus answered 4/7, 2018 at 8:51 Comment(0)
S
0

You can also remove the vc-mode related part from your modeline entirely:

(setq-default mode-line-format (delete '(vc-mode vc-mode) mode-line-format))
Sextain answered 16/2 at 17:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.