diff --git a/Configuration.org b/Configuration.org index df30ae163385058edf6a0323e60b103af39424ad..e20be81b6a6c3657904d701c8e26be514956238b 100644 --- a/Configuration.org +++ b/Configuration.org @@ -1019,6 +1019,24 @@ checkout -p~) :color blue)) #+END_SRC +Affiche les statistiques ~git~ dans la Modeline +#+BEGIN_SRC emacs-lisp +(defadvice vc-git-mode-line-string (after plus-minus (file) compile activate) + "Show the information of git diff on modeline." + (setq ad-return-value + (concat (propertize ad-return-value 'face '(:foreground "white" :weight bold)) + " [" + (let ((plus-minus (vc-git--run-command-string + file "diff" "--numstat" "--"))) + (if (and plus-minus + (string-match "^\\([0-9]+\\)\t\\([0-9]+\\)\t" plus-minus)) + (concat + (propertize (format "+%s" (match-string 1 plus-minus)) 'face '(:foreground "green3")) + (propertize (format "-%s" (match-string 2 plus-minus)) 'face '(:inherit font-lock-warning-face))) + (propertize "✔" 'face '(:foreground "green3" :weight bold)))) + "]"))) +#+END_SRC + ** FlySpell Correcteur orthographique à la volée. #+BEGIN_SRC emacs-lisp