diff options
Diffstat (limited to 'yoshi-mode-line.el')
| -rw-r--r-- | yoshi-mode-line.el | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/yoshi-mode-line.el b/yoshi-mode-line.el index e06dfea..840bfb9 100644 --- a/yoshi-mode-line.el +++ b/yoshi-mode-line.el @@ -69,9 +69,30 @@ (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) ""))))) +(defun yoshi-mode-line-mode-name () + "Display the current mode in a nice way." + (cond + ((derived-mode-p '(org-journal-mode)) + (propertize mode-name 'display `(image :type svg :file ,(expand-file-name "org-journal.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height)))) + ((derived-mode-p '(php-mode)) + (propertize mode-name 'display `(image :type svg :file ,(expand-file-name "php.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height)))) + ((derived-mode-p '(emacs-lisp-mode)) + (propertize mode-name 'display `(image :type svg :file ,(expand-file-name "emacs.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height)))) + ((derived-mode-p '(magit-mode)) + (propertize mode-name 'display `(image :type svg :file ,(expand-file-name "magit.svg" yoshi-mode-line-icons-dir) :ascent center :height ,(window-default-font-height)))) + (t + mode-name))) + (setq vc-display-status nil) +(setq-default mode-line-buffer-identification + (list + (apply 'propertize " %b " (text-properties-at 0 (car mode-line-buffer-identification))))) (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)))) mode-line-format-right-align (:eval (yoshi-mode-line-vc-display)) mode-line-front-space)) + `("%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-mode-name)) " " (:eval (yoshi-mode-line-vc-display)) mode-line-front-space)) +;;; Remove the major mode from the main mode line area. +(setq mode-line-modes (seq-remove-at-position mode-line-modes 3)) (provide 'yoshi-mode-line) ;;; yoshi-mode-line.el ends here |
