5

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
slinkp
  • 3,406
  • 2
  • 21
  • 18

3 Answers3

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!

slinkp
  • 3,406
  • 2
  • 21
  • 18
2

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) ""))
Rudolf Adamkovič
  • 31,030
  • 13
  • 103
  • 118
legoscia
  • 39,593
  • 22
  • 116
  • 167
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

rofrol
  • 14,438
  • 7
  • 79
  • 77