Try to cleanup the modeline

master
Jacopo De Simoi 6 years ago
parent aa481a0c15
commit 7342b4a809
  1. 3
      .gitmodules
  2. 74
      global.org
  3. 1
      margin-current-line

3
.gitmodules vendored

@ -103,3 +103,6 @@
[submodule "emacs-application-framework"]
path = emacs-application-framework
url = gh:emacs-application-framework
[submodule "margin-current-line"]
path = margin-current-line
url = gh:margin-current-line

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

@ -0,0 +1 @@
Subproject commit 8ea1bb774ee1163bf49bc15831156056fd646f1e
Loading…
Cancel
Save