(Emacs)~mode line now pads vc information

This commit is contained in:
2023-08-20 17:37:02 +01:00
parent d04e608104
commit 9a7e832806

View File

@@ -302,25 +302,33 @@ Currently I use the default mode line with some customisation;
simplicity is above all. simplicity is above all.
*** Emacs Mode-line *** Emacs Mode-line
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun +mode-line/generate-padding ()
(let ((wid (frame-width))
(str ""))
(dotimes (n (floor (/ wid 7)))
(setq str (concat str " ")))
str))
(setq-default (setq-default
mode-line-format mode-line-format
(list "%l:%c " ;; Line and column (list
"%p[" ;; Where in file + Evil state "%l:%c " ;; Line and column
'(:eval (upcase "%p[" ;; Where in file + Evil state
(substring '(:eval (upcase
(format "%s" (if (bound-and-true-p evil-state) (substring
evil-state (format "%s" (if (bound-and-true-p evil-state)
"")) evil-state
0 1))) ""))
"] " 0 1)))
"%+%b(" "] "
'(:eval (format "%s" major-mode)) "%+%b("
") " '(:eval (format "%s" major-mode))
"%I " ") "
'(vc-mode vc-mode) "%I "
" " '(:eval (+mode-line/generate-padding))
mode-line-misc-info '(vc-mode vc-mode)
mode-line-end-spaces)) mode-line-misc-info
mode-line-end-spaces))
#+end_src #+end_src
*** WIP Telephone-line *** WIP Telephone-line
:PROPERTIES: :PROPERTIES: