(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,9 +302,17 @@ 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
"%l:%c " ;; Line and column
"%p[" ;; Where in file + Evil state "%p[" ;; Where in file + Evil state
'(:eval (upcase '(:eval (upcase
(substring (substring
@@ -317,8 +325,8 @@ simplicity is above all.
'(:eval (format "%s" major-mode)) '(:eval (format "%s" major-mode))
") " ") "
"%I " "%I "
'(:eval (+mode-line/generate-padding))
'(vc-mode vc-mode) '(vc-mode vc-mode)
" "
mode-line-misc-info mode-line-misc-info
mode-line-end-spaces)) mode-line-end-spaces))
#+end_src #+end_src