1
0
Fork 0
mirror of https://git.sr.ht/~ryuslash/yoshi-theme synced 2025-07-10 19:43:06 +02:00

yoshi-mode-line: Show VC information on the right

This commit is contained in:
Tom Willemse 2025-05-08 23:46:27 -07:00
parent 9299d9db26
commit 2f6f22de10
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.58536 17.4132C1.80488 16.6327 1.80488 15.3673 2.58536 14.5868L14.5868 2.58536C15.3673 1.80488 16.6327 1.80488 17.4132 2.58536L29.4146 14.5868C30.1951 15.3673 30.1951 16.6327 29.4146 17.4132L17.4132 29.4146C16.6327 30.1951 15.3673 30.1951 14.5868 29.4146L2.58536 17.4132Z" fill="#EE513B"/>
<path d="M12.1489 5.06152L10.9336 6.27686L14.0725 9.41577C13.9455 9.68819 13.8746 9.99201 13.8746 10.3124C13.8746 11.222 14.4461 11.9981 15.2496 12.3012V19.9798C14.4461 20.2829 13.8746 21.059 13.8746 21.9686C13.8746 23.1422 14.826 24.0936 15.9996 24.0936C17.1732 24.0936 18.1246 23.1422 18.1246 21.9686C18.1246 21.144 17.6549 20.429 16.9684 20.0768V12.3117L19.9689 15.3122C19.8481 15.5791 19.7809 15.8754 19.7809 16.1874C19.7809 17.361 20.7323 18.3124 21.9059 18.3124C23.0795 18.3124 24.0309 17.361 24.0309 16.1874C24.0309 15.0138 23.0795 14.0624 21.9059 14.0624C21.6778 14.0624 21.4582 14.0983 21.2522 14.1648L18.0297 10.9423C18.0914 10.7433 18.1246 10.5317 18.1246 10.3124C18.1246 9.13878 17.1732 8.18738 15.9996 8.18738C15.7803 8.18738 15.5688 8.22061 15.3697 8.2823L12.1489 5.06152Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -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