-
-
Save mmarshall540/e420f6848e39e45c6981e0f0418f5ea2 to your computer and use it in GitHub Desktop.
(setopt mode-line-format | |
'("%e" | |
mode-line-front-space | |
;; removed mode-line-mule-info | |
mode-line-client | |
mode-line-modified | |
mode-line-remote | |
mode-line-window-dedicated | |
;; removed `display' property from the above constructs | |
"\t" ; added | |
mode-line-frame-identification | |
mode-line-buffer-identification | |
" " | |
mode-line-position | |
mode-line-format-right-align ; added | |
(project-mode-line project-mode-line-format) | |
(vc-mode vc-mode) | |
" " | |
mode-line-modes | |
mode-line-misc-info | |
" " ; added | |
mode-line-end-spaces)) | |
(setopt mode-line-modified | |
'((:eval (if buffer-read-only "R" "")) | |
(:propertize | |
(:eval (if (buffer-modified-p) "×" "")) face error))) | |
(setopt mode-line-modes (remove "(" (remove ")" mode-line-modes))) | |
(setopt mode-line-position-column-line-format '("%l:%c")) | |
(setopt mode-line-position-line-format '("L%l")) | |
(setopt mode-line-remote | |
'(:eval (if (file-remote-p default-directory) "☎" ""))) | |
(setopt mode-line-right-align-edge 'window) |
Updated to using tab character to align buffer-name to ensure it doesn't move, even on Windows, where apparently the spacing was different.
Switched to using a colon to separate line number and column number in column-number-mode
. Reason being that the "LATIN LETTER PIPE" that I had there wasn't covered by the fonts on my Windows work laptop. I didn't want to bother with fixing it, even though it looked a little bit nicer. My goal for this is to keep it simple, not perfect.
Also for indicating a remote connection, I switched from the satellite dish emoji character to the simple "BLACK TELEPHONE" character, which is more universal. Same reason as in the last paragraph.
Updated to improve readability of mode-line-format
value and to indicate what changes were made to it in comments.
This uses the
mode-line-format-right-align
mode-line construct and themode-line-right-align-edge
user-option, both of which are new features in Emacs 30.It also uses a combination of regular spaces and tabs to align the buffer name. I'm using the Lexend Exa font in my mode-line, so you might need to adjust if your font is different, but probably not.
EDIT (screenshots):
Regular:
And with Prot's spacious-padding and
spacious-padding-subtle-mode-line
enabled: