diff options
Diffstat (limited to 'lisp/+modeline.el')
-rw-r--r-- | lisp/+modeline.el | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index a0195f1..3f25a40 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el | |||
@@ -88,7 +88,7 @@ This function makes a lambda, so you can throw it straight into | |||
88 | (defun +modeline-major-mode (&optional spacer) | 88 | (defun +modeline-major-mode (&optional spacer) |
89 | "Display the current `major-mode'." | 89 | "Display the current `major-mode'." |
90 | (concat (or spacer +modeline-default-spacer) | 90 | (concat (or spacer +modeline-default-spacer) |
91 | (propertize (+string-truncate (format-mode-line mode-name) 12) | 91 | (propertize (+string-truncate (format-mode-line mode-name) 16) |
92 | 'face 'bold | 92 | 'face 'bold |
93 | 'keymap mode-line-major-mode-keymap | 93 | 'keymap mode-line-major-mode-keymap |
94 | 'help-echo (concat (format-mode-line mode-name) | 94 | 'help-echo (concat (format-mode-line mode-name) |
@@ -185,27 +185,30 @@ The order of elements matters: whichever one matches first is applied." | |||
185 | 185 | ||
186 | (defun +modeline-position (&optional _) ; adapted from `simple-modeline' | 186 | (defun +modeline-position (&optional _) ; adapted from `simple-modeline' |
187 | "Display the current cursor position." | 187 | "Display the current cursor position." |
188 | (list '((line-number-mode | 188 | (let ((sep "|") (before " [") (after "]")) |
189 | ((column-number-mode | 189 | (list `(:propertize (line-number-mode |
190 | (column-number-indicator-zero-based | 190 | ((column-number-mode |
191 | (9 " %l:%c") | 191 | (column-number-indicator-zero-based |
192 | (9 " %l:%C")) | 192 | ,(concat before "%l" sep "%c" after) |
193 | (6 " %l:"))) | 193 | ,(concat before "%l" sep "%C" after)) |
194 | ((column-number-mode | 194 | ,(concat before "%l" sep "" after))) |
195 | (column-number-indicator-zero-based | 195 | ((column-number-mode |
196 | (5 " :%c") | 196 | (column-number-indicator-zero-based |
197 | (5 " :%C")))))) | 197 | ,(concat before sep "%c" after) |
198 | '(file-percentage-mode | 198 | ,(concat before sep "%C" after))))) |
199 | ((-3 "%p") "%% ")) | 199 | font-lock-face font-lock-comment-face) |
200 | (if (region-active-p) | 200 | (if (region-active-p) |
201 | (propertize (format "%s%-5d" | 201 | (propertize (format "%s%-5d" |
202 | (if (and (mark) (< (point) (mark))) "-" "+") | 202 | (if (and (mark) (< (point) (mark))) "-" "+") |
203 | (apply '+ (mapcar | 203 | (apply '+ (mapcar |
204 | (lambda (pos) | 204 | (lambda (pos) |
205 | (- (cdr pos) | 205 | (- (cdr pos) |
206 | (car pos))) | 206 | (car pos))) |
207 | (region-bounds)))) | 207 | (region-bounds)))) |
208 | 'font-lock-face 'font-lock-variable-name-face)))) | 208 | 'font-lock-face 'font-lock-variable-name-face)) |
209 | '(:propertize (file-percentage-mode | ||
210 | (" " (-3 "%p") "%%")) | ||
211 | font-lock-face font-lock-comment-face)))) | ||
209 | 212 | ||
210 | (defun +modeline-vc (&optional spacer) | 213 | (defun +modeline-vc (&optional spacer) |
211 | "Display the version control branch of the current buffer in the modeline." | 214 | "Display the version control branch of the current buffer in the modeline." |