-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmode-line.el
78 lines (58 loc) · 2.4 KB
/
mode-line.el
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
66
67
68
69
70
71
72
73
74
75
76
77
; Make erc tracking come after everything else
(setq erc-track-position-in-mode-line 'after-modes)
; Don't show me the time.
; ... not sure of a nicer way to do this :)
(display-time-mode nil)
; borrowed heavily from
; http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html
(setq-default mode-line-format
(list
'(:eval (when overwrite-mode
(propertize
"Ovr"
'face 'font-lock-preprocessor-face
'help-echo (concat "Buffer is in "
(if overwrite-mode "overwrite" "insert") " mode"))))
;; was this buffer modified since the last save?
'(:eval (when (buffer-modified-p)
(propertize "Mod"
'face 'font-lock-warning-face
'help-echo "Buffer has been modified")))
;; is this buffer read-only?
'(:eval (when buffer-read-only
(propertize "RO"
'face 'font-lock-type-face
'help-echo "Buffer is read-only")))
" "
;; the buffer name; the file name as a tool tip
'(:eval (propertize "%b " 'face 'font-lock-keyword-face
'help-echo (buffer-file-name)))
;; line and column
(propertize "%02l," 'face 'font-lock-type-face)
; warn if we go over 80 characters
'(:eval (propertize "%02c" 'face
(if (>= (current-column) 80)
'font-lock-warning-face
'font-lock-type-face)))
" "
mode-name
" "
'(global-mode-string global-mode-string)
" "
;; revision control info
'(vc-mode vc-mode)
" "
;; '(:eval (when nyan-mode (list (nyan-create) " ")))
'(:eval (when (and erc-track-mode cwebber/show-erc-in-mode-line)
(list erc-modified-channels-object)))
;; i don't want to see minor-modes; but if you want, uncomment this:
minor-mode-alist ;; list of minor modes
"%-" ;; fill with '-'
))
(defvar cwebber/show-erc-in-mode-line t)
(defun cwebber/toggle-show-erc ()
(interactive)
(if cwebber/show-erc-in-mode-line
(setq cwebber/show-erc-in-mode-line nil)
(setq cwebber/show-erc-in-mode-line t)))
(global-set-key (kbd "C-c E") 'cwebber/toggle-show-erc)