.emacs.d/lisp/init-modeline.el
2024-09-06 11:42:11 +02:00

58 lines
2.2 KiB
EmacsLisp

;;; init-modeline.el --- dooom-modeline configuration
;;; Commentary:
;;; Code:
(setq-default mode-line-format
(list
;; the buffer name; the file name as a tool tip
'(:eval (propertize " %b "
'face
(let ((face (buffer-modified-p)))
(if face 'font-lock-warning-face
'font-lock-type-face))
'help-echo (buffer-file-name)))
;; line and column
" (" ;; '%02' to set to 2 chars at least; prevents flickering
(propertize "%02l" 'face 'font-lock-keyword-face) ","
(propertize "%02c" 'face 'font-lock-keyword-face)
") "
;; relative position, size of file
" ["
(propertize "%p" 'face 'font-lock-constant-face) ;; % above top
"/"
(propertize "%I" 'face 'font-lock-constant-face) ;; size
"] "
;; spaces to align right
'(:eval (propertize
" " 'display
`((space :align-to (- (+ right right-fringe right-margin)
,(+ 3 (string-width (if (listp mode-name) (car mode-name) mode-name))))))))
;(propertize org-mode-line-string 'face '(:foreground "#5DD8FF"))
'(eval (propertize
`((let ((backend (vc-backend buffer-file-name)))
(substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))))
)
))
(set-face-attribute 'mode-line nil
:background "#353644"
:foreground "white"
:box '(:line-width 8 :color "#353644")
:overline nil
:underline nil)
(set-face-attribute 'mode-line-inactive nil
:background "#565063"
:foreground "white"
:box '(:line-width 8 :color "#565063")
:overline nil
:underline nil)
(provide 'init-modeline)
;;; end of init-doom-modeline.el