(Emacs/config)~Fix up some stuff in mode line
This commit is contained in:
@@ -324,14 +324,14 @@ the mode line to achieve this.
|
|||||||
)
|
)
|
||||||
+better-mode-line/right-segment ;; RIGHT SEGMENT
|
+better-mode-line/right-segment ;; RIGHT SEGMENT
|
||||||
'((:eval (if (project-current) ;; Name of current project (if any)
|
'((:eval (if (project-current) ;; Name of current project (if any)
|
||||||
(project-name
|
(concat (project-name
|
||||||
(project-current))))
|
(project-current))
|
||||||
(vc-mode vc-mode) ;; Git branch (if any)
|
vc-mode) ;; ... with git branch
|
||||||
" "
|
""))
|
||||||
(:eval ;; LSP information
|
(:eval ;; LSP information
|
||||||
(with-eval-after-load "eglot"
|
(with-eval-after-load "eglot"
|
||||||
(if eglot--managed-mode
|
(if eglot--managed-mode
|
||||||
(eglot--mode-line-format))))
|
(concat " " (eglot--mode-line-format)))))
|
||||||
mode-line-misc-info ;; Any other information
|
mode-line-misc-info ;; Any other information
|
||||||
))
|
))
|
||||||
:config
|
:config
|
||||||
|
|||||||
@@ -27,18 +27,6 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(defun +better-mode-line/evil-state ()
|
|
||||||
"Returns either the empty string if no evil-state is defined or
|
|
||||||
the first character of the evil state capitalised"
|
|
||||||
(with-eval-after-load "evil"
|
|
||||||
(if (bound-and-true-p evil-state)
|
|
||||||
(upcase
|
|
||||||
(substring
|
|
||||||
(format "%s"
|
|
||||||
evil-state)
|
|
||||||
0 1))
|
|
||||||
"")))
|
|
||||||
|
|
||||||
(defvar +better-mode-line/left-segment nil
|
(defvar +better-mode-line/left-segment nil
|
||||||
"List of elements that are placed on the left of the mode-line")
|
"List of elements that are placed on the left of the mode-line")
|
||||||
|
|
||||||
@@ -51,6 +39,18 @@ the first character of the evil state capitalised"
|
|||||||
(defconst +better-mode-line/--minimum-padding 4
|
(defconst +better-mode-line/--minimum-padding 4
|
||||||
"Minimum size of padding string.")
|
"Minimum size of padding string.")
|
||||||
|
|
||||||
|
(defun +better-mode-line/evil-state ()
|
||||||
|
"Returns either the empty string if no evil-state is defined or
|
||||||
|
the first character of the evil state capitalised"
|
||||||
|
(with-eval-after-load "evil"
|
||||||
|
(if (bound-and-true-p evil-state)
|
||||||
|
(upcase
|
||||||
|
(substring
|
||||||
|
(format "%s"
|
||||||
|
evil-state)
|
||||||
|
0 1))
|
||||||
|
"")))
|
||||||
|
|
||||||
(defun +better-mode-line/--get-padding-size (centre-size other-size)
|
(defun +better-mode-line/--get-padding-size (centre-size other-size)
|
||||||
(let* ((win-width (window-width))
|
(let* ((win-width (window-width))
|
||||||
(margins (window-margins))
|
(margins (window-margins))
|
||||||
|
|||||||
Reference in New Issue
Block a user