1

Here is my current custom, but I don't know how to customize its face. And it only shows branch name, no other status info.

(setq-default
 mode-line-format
 (quote
  ((:eval
    (if vc-mode
        (progn
          (list
           (propertize " ⭠"
                       'face '(:foreground "sky blue"))
           ;; TODO: propertize this. set face height to 75
           `(vc-mode vc-mode)
           ))))
   )))

I hope someone can give out a better solution. Or at least tell me how to custom my upper status (vc-mode vc-mode) face.

  • Can you further suggest how to display the current branch in the dired modeline? – Troy Folger May 12 '17 at 18:20
5

In git, if you hover the mouse over the mode line portion which starts "Git", you get more information such as the branch and update status.

Looks like you've asked about mode line customization before here and here, so you should understand how to set values in the mode line.

To get the status of the file, the function you want is:

(vc-state (buffer-file-name (current-buffer)))

And to get the branch:

(vc-working-revision (buffer-file-name (current-buffer)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.