diff options
| author | 2025-05-08 23:46:27 -0700 | |
|---|---|---|
| committer | 2025-05-08 23:47:48 -0700 | |
| commit | 2f6f22de1077932fa84a615c81c4184a82359fde (patch) | |
| tree | d042cea00f9260b1120827fb16e3458a04408581 /yoshi-mode-line.el | |
| parent | 9299d9db26ecf25f437a71278258bb3b57aa1394 (diff) | |
| download | yoshi-theme-2f6f22de1077932fa84a615c81c4184a82359fde.tar.gz yoshi-theme-2f6f22de1077932fa84a615c81c4184a82359fde.zip | |
yoshi-mode-line: Show VC information on the right
Diffstat (limited to 'yoshi-mode-line.el')
| -rw-r--r-- | yoshi-mode-line.el | 13 |
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 |
