Skip to content
Snippets Groups Projects
Commit 43538eb5 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Ajout etat git dans la modeline

parent c1ea5c7d
No related branches found
No related tags found
No related merge requests found
......@@ -1018,6 +1018,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment