summaryrefslogtreecommitdiff
path: root/emacs/work_inits/02-modeline.el
blob: 6ea2b075332ee0c8fa84f7a2d7e12cabeae6c4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;; Time-stamp: <2021-09-27 08h47 EDT (hobbies)>

;; -----------------------------------------------------------------------------
;; Mode-line
;;
;; The mode-line is set to eliminate duplicate information between buffers.
;; Everything else is intended to be displayed in another, centralised location.

(defun abbreviate-left-trim-path (p len)
  (let ((pa (abbreviate-file-name p)))
    (if (> (length pa) (+ 3 len))
	(format "...%s" (substring pa (- (length pa) len)))
      pa)))

(setq display-time-format "%d/%H.%M"
      display-time-default-load-average nil)
(display-time-mode 1)

(setq global-mode-string nil)
(setq-default mode-line-format
              '("" mode-line-front-space
                mode-line-modified "%@"
                " %l:%c %[" mode-line-buffer-identification "%] %I"
                " " mode-line-modes ;; (vc-mode vc-mode)
                (:eval (abbreviate-left-trim-path default-directory 20))
                mode-line-misc-info mode-line-end-spaces))

;; -----------------------------------------------------------------------------
;; Minions to clean mode-line

(use-package minions
  :ensure t
  :config
  (setq minions-mode-line-lighter ":"
	minions-direct '(god-local-mode))
  (minions-mode 1))