Also show percentage of file in the modeline

This commit is contained in:
Case Duckworth 2021-09-29 17:21:01 -05:00
parent 6198dfb726
commit 17b01d3eb5
2 changed files with 11 additions and 3 deletions

View File

@ -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)))

View File

@ -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.