Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Created October 10, 2012 17:17
Show Gist options
  • Save Idorobots/3867028 to your computer and use it in GitHub Desktop.
Save Idorobots/3867028 to your computer and use it in GitHub Desktop.
VC colors
(defvar my-vc-alist '(;; Everything is ok:
(up-to-date some-green-face)
;; Kinda important:
(edited some-yellow-face)
(added some-yellow-face)
;; Most important:
;; ...
))
(setq mode-line-format
(list ;; ...
'(:eval (let ((file-name (buffer-file-name)))
(if file-name
(let ((state-face (assoc (vc-state file-name)
my-vc-alist))
(revision (vc-working-revision file-name)))
(propertize (concat "%b"
(when revision
(concat " [" revision "]")))
'face (cadr state-face)))
"%b")))
;; ...
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment