From 17b01d3eb51f21e0e77ca699da1dee3ea7482c3f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 29 Sep 2021 17:21:01 -0500 Subject: Also show percentage of file in the modeline --- init.el | 3 ++- lisp/acdw-modeline.el | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 04b50aa..c3cbb68 100644 --- a/init.el +++ b/init.el @@ -1081,7 +1081,8 @@ specific to most general, they are these: word-wrap t wrap-prefix (repeat-string acdw-irc/left-margin " ") line-number-mode nil - column-number-mode nil) + column-number-mode nil + file-percentage-mode nil) (:hook #'enable-lui-track))) diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index 25502ec..9963309 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -125,6 +125,10 @@ indicator in the mode-line." 'mouse-2 #'mode-line-widen)) 'mouse-face 'mode-line-highlight)))) +(define-minor-mode file-percentage-mode + "Toggle the percentage display in the mode line (File Percentage Mode)." + :init-value t :global t :group 'mode-line) + (defun acdw-modeline/position () "Displays the current cursor position in the mode-line. @@ -140,7 +144,10 @@ is, if point < mark." ((column-number-mode (column-number-indicator-zero-based (5 " C%c") - (5 " C%C"))))) + (5 " C%C"))) + " ")) + (file-percentage-mode + (7 "%p%% ")) ,(if (region-active-p) (propertize (format "%s%-5d" (if (and (mark) @@ -183,7 +190,7 @@ is, if point < mark." (defun acdw-modeline/wc () "Display current `wc-buffer-stats'." (when (bound-and-true-p wc-mode) - (or wc-buffer-stats "[w]"))) + (or wc-buffer-stats " [w]"))) (defun acdw-modeline/winum () "Show the `winum' number of the current window in the modeline. -- cgit 1.4.1-21-gabe81