blob: 35c486e5827ba36b444898ae4c715e88381bad14 (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
;;;; remove all the stupid stupid stupid crap
(define-minor-mode minor-mode-blackout-mode
"Hides minor modes from the mode line."
t)
(catch 'done
(mapc (lambda (x)
(when (and (consp x)
(equal (cadr x) '("" minor-mode-alist)))
(let ((original (copy-sequence x)))
(setcar x 'minor-mode-blackout-mode)
(setcdr x (list "" original)))
(throw 'done t)))
mode-line-modes))
(global-set-key (kbd "C-c ,") 'minor-mode-blackout-mode)
(defface bd/bold-shadow
`((t :inherit shadow
:bold t))
"Shadow with bold.")
(defvar-local bd/buffer-identification-mode-line
'(:eval (format "%s" (propertize (buffer-name) 'face 'bd/bold-shadow)))
"Formats the modeline-buffer-name.")
;;;; pos
(column-number-mode)
(setopt mode-line-position-column-line-format '(" %l:%c "))
(defvar-local bd/line-position
'(:eval
(when (mode-line-window-selected-p)
;; remove the percentage
(cdr mode-line-position))))
;;;; git
(defvar-local bd/vc-mode-line
'(:eval (when vc-mode
(format "-- %s"
(propertize (cadr (split-string vc-mode "[:-]")) 'face 'shadow))))
"Formats the checked out git repository.")
(dolist (construct '(bd/buffer-identification-mode-line
bd/vc-mode-line))
(put construct 'risky-local-variable t))
(setq-default mode-line-format
(list
mode-line-front-space
bd/buffer-identification-mode-line
" -- "
mode-line-modes
bd/vc-mode-line
" -- "
bd/line-position))
(provide 'bd--modeline)
;;; bd-modeline ends here
|