2

This is something I asked on the official repository.

By default, smart-mode-line displays the current projectile project-name before the buffer-name, and the vc-mode string after it:

... [P/myproject]BUFFER-NAME :master ...  

I would like to combine the project name and the branch together, and display them both before the buffer-name.
Here is what I want to achieve:

... [myproject:master]BUFFER-NAME ...
Malabarba
  • 22,878
  • 6
  • 78
  • 163
Mathieu Marques
  • 1,953
  • 1
  • 13
  • 30

1 Answers1

0

No other way (that I know of) than writing a custom mode-line customizing mode-line-format.

Here is how I did it.

And to strip the backend string ("Git" from "Git:master"):

(defadvice vc-mode-line (after me/vc-mode-line () activate)
  "Strip backend from the VC information."
  (when (stringp vc-mode)
    (let ((vc-text (replace-regexp-in-string "^ Git." ":" vc-mode)))
      (setq vc-mode vc-text))))
Mathieu Marques
  • 1,953
  • 1
  • 13
  • 30