emacs.d/lisp/init-ui.el 3.2 K raw
1
;;; init-ui.el -*- lexical-binding: t; -*-
2
3
(when (display-graphic-p)
4
  (set-face-attribute 'default nil :family "BerkeleyMono Nerd Font" :height 110))
5
6
(use-package base16-theme)
7
(use-package nord-theme)
8
9
(load-theme 'base16-nord t)
10
11
;;; Mode line
12
;; Evil's own indicator is dropped; the state is drawn by hand as a colored
13
;; square with the state letter. Icons are Nerd Font glyphs.
14
(setq evil-mode-line-format nil
15
      evil-echo-state nil)   ; no "-- INSERT --" in the echo area
16
(column-number-mode 1)
17
18
;; (defvar my/ml-states
19
;;   `((normal   "N" ,(alist-get 'base08 darkmatter-palette))
20
;;     (insert   "I" ,(alist-get 'base0A darkmatter-palette))
21
;;     (visual   "V" ,(alist-get 'base0B darkmatter-palette))
22
;;     (replace  "R" ,(alist-get 'red darkmatter-palette))
23
;;     (operator "O" ,(alist-get 'base0D darkmatter-palette))
24
;;     (motion   "M" ,(alist-get 'base0D darkmatter-palette))
25
;;     (emacs    "E" ,(alist-get 'base09 darkmatter-palette)))
26
;;   "Evil state -> (letter color) for the mode line.")
27
28
;; (defun my/ml-evil-state ()
29
;;   "Colored square with the current evil state letter."
30
;;   (when (bound-and-true-p evil-local-mode)
31
;;     (pcase-let ((`(,letter ,color) (or (alist-get evil-state my/ml-states)
32
;;                                        '("?" "#666666"))))
33
;;       (propertize (format " %s " letter)
34
;;                   'face `(:background ,color
35
;;                                       :foreground ,(alist-get 'base00 darkmatter-palette)
36
;;                                       :weight bold)))))
37
38
(setq-default
39
 mode-line-format
40
 '("%e"
41
   (:eval (my/ml-evil-state))
42
   "  "
43
   (:eval (when (and buffer-file-name (buffer-modified-p))
44
            (propertize "\uf111 " 'face '(:foreground "#e78a53"))))   ; nf-fa-circle
45
   (:propertize "%b" face mode-line-buffer-id)
46
   (:eval (when buffer-read-only "  \uf023"))                        ; nf-fa-lock
47
   "  "
48
   mode-name
49
   (:eval (when vc-mode
50
            (concat "  \ue0a0 "                                      ; branch
51
                    (string-trim (replace-regexp-in-string "^ *Git[-:]" "" vc-mode)))))
52
   mode-line-format-right-align
53
   ;; ERC / jabber activity ([#chan,...]) lives here
54
   (:eval (when (string-match-p "[^ ]" (format-mode-line global-mode-string))
55
            global-mode-string))
56
   "  %l:%c  %p "))
57
58
(setq initial-scratch-message
59
      " .              +   .                .   . .     .  .
60
                   .                    .       .     *
61
  .       *                        . . . .  .   .  + .
62
            \"You Are Here\"            .   .  +  . . .
63
.                 |             .  .   .    .    . .
64
                  |           .     .     . +.    +  .
65
                 \\|/            .       .   . .
66
        . .       V          .    * . . .  .  +   .
67
           +      .           .   .      +
68
                            .       . +  .+. .
69
  .                      .     . + .  . .     .      .
70
           .      .    .     . .   . . .        ! /
71
      *             .    . .  +    .  .       - O -
72
          .     .    .  +   . .  *  .       . / |
73
               . + .  .  .  .. +  .
74
.      .  .  .  *   .  *  . +..  .            *
75
 .      .   . .   .   .   . .  +   .    .            +
76
77
")
78
79
(provide 'init-ui)