|
|
|
|
@ -171,12 +171,13 @@ |
|
|
|
|
(setq-default display-buffer-reuse-frames t) |
|
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
|
|
** Modeline |
|
|
|
|
** Mode-line |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
(setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·")) ;Still needs some improvements, does not report Readonly state |
|
|
|
|
(setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·")) |
|
|
|
|
;Still needs some improvements, does not report Readonly state |
|
|
|
|
mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) |
|
|
|
|
(cond |
|
|
|
|
((equal s "-") "·") ((equal s "@") "@") (t s))))) |
|
|
|
|
((equal s "-") " ") ((equal s "@") "@") (t s))))) |
|
|
|
|
|
|
|
|
|
(defface mode-line-indicator |
|
|
|
|
'((t nil)) |
|
|
|
|
@ -200,7 +201,6 @@ |
|
|
|
|
|
|
|
|
|
(add-hook 'buffer-list-update-hook (lambda () (walk-windows #'mode-line-update-face nil t))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar wilder-buffer-vc-mode-line |
|
|
|
|
'("%b" (vc-mode (:propertize |
|
|
|
|
;; Strip the backend name from the VC status information |
|
|
|
|
@ -212,7 +212,7 @@ |
|
|
|
|
face magit-branch-local)))) |
|
|
|
|
|
|
|
|
|
(defvar wilder-position |
|
|
|
|
'("[%p·%I] " )) |
|
|
|
|
'("%p · %I" )) |
|
|
|
|
|
|
|
|
|
(put 'wilder-buffer-vc-mode-line 'risky-local-variable t) |
|
|
|
|
(put 'wilder-position 'risky-local-variable t) |
|
|
|
|
@ -231,21 +231,58 @@ |
|
|
|
|
(propertize "%]" 'help-echo recursive-edit-help-echo) |
|
|
|
|
" ")) |
|
|
|
|
"Mode line construct for displaying major and minor modes.") |
|
|
|
|
|
|
|
|
|
(put 'wilder/mode-line-modes 'risky-local-variable t) |
|
|
|
|
|
|
|
|
|
(setq-default mode-line-format |
|
|
|
|
'("%e" |
|
|
|
|
mode-line-front-space |
|
|
|
|
mode-line-mule-info |
|
|
|
|
mode-line-modified |
|
|
|
|
mode-line-remote |
|
|
|
|
mode-line-frame-identification |
|
|
|
|
wilder-buffer-vc-mode-line " " |
|
|
|
|
wilder-position |
|
|
|
|
(:propertize " " face mode-line-indicator) |
|
|
|
|
wilder/mode-line-modes |
|
|
|
|
mode-line-misc-info |
|
|
|
|
mode-line-end-spaces)) |
|
|
|
|
(setq-default header-line-format nil);'("%e" ));wilder-buffer-vc-mode-line)) |
|
|
|
|
|
|
|
|
|
(defun simple-mode-line-render (left right) |
|
|
|
|
"Return a string of `window-width' length containing LEFT, and RIGHT |
|
|
|
|
aligned respectively." |
|
|
|
|
(let* ((available-width (- (window-width) (length left) 2))) |
|
|
|
|
(format (format " %%s %%%ds " available-width) left right))) |
|
|
|
|
|
|
|
|
|
(defun mode-line-left-right (left right) |
|
|
|
|
(let* ((len-left (length (format-mode-line left))) |
|
|
|
|
(len-right (length (format-mode-line right))) |
|
|
|
|
(len-separator (- (window-width) (+ len-left len-right 3))) |
|
|
|
|
(separator (format (format "%%%ds" len-separator) ""))) |
|
|
|
|
(append left (list separator) right))) |
|
|
|
|
|
|
|
|
|
(defvar mode-line-separator |
|
|
|
|
(let* ((len-left (length (format-mode-line mode-line-format-left))) |
|
|
|
|
(len-right (length (format-mode-line mode-line-format-right))) |
|
|
|
|
(len-separator (- (window-width) (+ len-left len-right)))) |
|
|
|
|
(format (format "%%%ds" len-separator) ""))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defvar mode-line-format-left |
|
|
|
|
'("%e" |
|
|
|
|
mode-line-front-space |
|
|
|
|
mode-line-front-space |
|
|
|
|
mode-line-front-space |
|
|
|
|
; mode-line-mule-info |
|
|
|
|
mode-line-modified |
|
|
|
|
mode-line-remote |
|
|
|
|
mode-line-frame-identification |
|
|
|
|
wilder-buffer-vc-mode-line |
|
|
|
|
" " |
|
|
|
|
wilder/mode-line-modes |
|
|
|
|
mode-line-misc-info)) |
|
|
|
|
|
|
|
|
|
(defvar mode-line-format-right |
|
|
|
|
'((:propertize " " face mode-line-indicator) |
|
|
|
|
wilder-position |
|
|
|
|
mode-line-end-spaces)) |
|
|
|
|
|
|
|
|
|
(put 'mode-line-format-left 'risky-local-variable t) |
|
|
|
|
(put 'mode-line-format-right 'risky-local-variable t) |
|
|
|
|
(put 'mode-line-separator 'risky-local-variable t) |
|
|
|
|
|
|
|
|
|
(setq-default mode-line-format |
|
|
|
|
'("%e" mode-line-format-left |
|
|
|
|
mode-line-separator |
|
|
|
|
mode-line-format-right)) |
|
|
|
|
#+END_SRC |
|
|
|
|
The following has been found in [[https://www.masteringemacs.org/article/hiding-replacing-modeline-strings][here]] to clean up the modeline |
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
@ -281,7 +318,6 @@ |
|
|
|
|
must pass the correct minor/major mode symbol and a string you |
|
|
|
|
want to use in the modeline *in lieu of* the original.") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun clean-mode-line () |
|
|
|
|
(interactive) |
|
|
|
|
(loop for cleaner in mode-line-cleaner-alist |
|
|
|
|
|