aboutsummaryrefslogtreecommitdiffstats
path: root/yoshi-mode-line.el
diff options
context:
space:
mode:
Diffstat (limited to 'yoshi-mode-line.el')
-rw-r--r--yoshi-mode-line.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/yoshi-mode-line.el b/yoshi-mode-line.el
index 541cdb8..e06dfea 100644
--- a/yoshi-mode-line.el
+++ b/yoshi-mode-line.el
@@ -59,8 +59,19 @@
(t
(propertize "read-write" 'display `(image :type svg :file ,(expand-file-name "file-solid.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height))))))
+(defun yoshi-mode-line-vc-display ()
+ "Display information about the current version control."
+ (let ((backend (vc-backend (buffer-file-name))))
+ (cl-case backend
+ (Git
+ (concat (vc-git--symbolic-ref (buffer-file-name))
+ " "
+ (propertize "git" 'display `(image :type svg :file ,(expand-file-name "git-svgrepo-com.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height)))))
+ (t (if backend (symbol-name backend) "")))))
+
+(setq vc-display-status nil)
(setq-default mode-line-format
- `("%e" mode-line-front-space (:eval (yoshi-mode-line-buffer-status-display)) " %z" ,@(cdr (cddadr (car (get 'mode-line-format 'standard-value))))))
+ `("%e" mode-line-front-space (:eval (yoshi-mode-line-buffer-status-display)) " %z" ,@(cdr (cddadr (car (get 'mode-line-format 'standard-value)))) mode-line-format-right-align (:eval (yoshi-mode-line-vc-display)) mode-line-front-space))
(provide 'yoshi-mode-line)
;;; yoshi-mode-line.el ends here