From 9a7e8328067dc0983bc7ee9c6d7fbebaaff929c6 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 20 Aug 2023 17:37:02 +0100 Subject: (Emacs)~mode line now pads vc information --- Emacs/.config/emacs/config.org | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'Emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index a1cd33f..4ea5d23 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -302,25 +302,33 @@ Currently I use the default mode line with some customisation; simplicity is above all. *** Emacs Mode-line #+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 mode-line-format - (list "%l:%c " ;; Line and column - "%p[" ;; Where in file + Evil state - '(:eval (upcase - (substring - (format "%s" (if (bound-and-true-p evil-state) - evil-state - "")) - 0 1))) - "] " - "%+%b(" - '(:eval (format "%s" major-mode)) - ") " - "%I " - '(vc-mode vc-mode) - " " - mode-line-misc-info - mode-line-end-spaces)) + (list + "%l:%c " ;; Line and column + "%p[" ;; Where in file + Evil state + '(:eval (upcase + (substring + (format "%s" (if (bound-and-true-p evil-state) + evil-state + "")) + 0 1))) + "] " + "%+%b(" + '(:eval (format "%s" major-mode)) + ") " + "%I " + '(:eval (+mode-line/generate-padding)) + '(vc-mode vc-mode) + mode-line-misc-info + mode-line-end-spaces)) #+end_src *** WIP Telephone-line :PROPERTIES: -- cgit v1.2.3-13-gbd6f