blob: 3dd728c8ac56f2ea29202eb1e9d52ed52549da46 (
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
;;; ss-ui.el --- Interface configuration -*- lexical-binding: t; -*-
;;; Commentary:
;; Theme, frame, completion, and interface setup.
;;; Code:
(require 'ss-core)
(defun ss-ui--configure-frames ()
"Apply GUI and terminal frame behavior."
(when (display-graphic-p)
(set-frame-size (selected-frame) 140 42)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(tooltip-mode -1)
(set-face-attribute
'default nil
:family "JetBrains Mono" :height 140 :weight 'medium)
(set-face-attribute
'fixed-pitch nil
:family "JetBrains Mono" :weight 'medium)
(set-face-attribute
'fixed-pitch-serif nil
:family "JetBrains Mono" :weight 'medium))
(unless (display-graphic-p)
;; Terminal menu bar removal stays on startup hook to avoid tty regressions.
(add-hook 'emacs-startup-hook (lambda () (menu-bar-mode -1)))))
(defun ss-ui--setup-modeline ()
"Configure the modeline."
(use-package time
:ensure nil
:config
(setq display-time-24hr-format t
display-time-day-and-date t
display-time-default-load-average nil
calendar-latitude -37.7667
calendar-longitude 145.0
calendar-location-name "Melbourne, VIC")
(display-time-mode 1))
;; Keep the theme's faces, but make the right edge alignment dynamic.
(setq-default mode-line-format
(list
" "
"%e"
mode-line-front-space
mode-line-mule-info
mode-line-client
mode-line-modified
mode-line-remote
mode-line-frame-identification
mode-line-buffer-identification
" "
mode-line-position
'(vc-mode vc-mode)
" "
mode-line-modes
'(:eval (propertize
" "
'display
`((space :align-to
(- right
,(+ 2 (string-width
(format-mode-line mode-line-misc-info))))))))
mode-line-misc-info
" "
mode-line-end-spaces)))
(defun ss-ui--setup-completion ()
"Configure minibuffer and in-buffer completion."
(use-package vertico
:ensure t
:pin melpa
:init
(vertico-mode 1))
(use-package orderless
:ensure t
:pin melpa
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles basic partial-completion)))))
(use-package marginalia
:ensure t
:pin melpa
:after vertico
:init
(marginalia-mode 1))
(use-package corfu
:ensure t
:pin gnu
:init
(global-corfu-mode 1)))
(defun ss-ui--setup-writing-layout ()
"Configure centered writing layout helpers."
(use-package olivetti
:ensure t
:pin melpa
:custom
(olivetti-body-width 100)))
(defun ss-ui-setup ()
"Initialize interface and completion behavior."
(setq inhibit-startup-message t
inhibit-startup-screen t
ring-bell-function 'ignore)
(ss-ui--configure-frames)
(use-package modus-themes
:ensure nil
:no-require t
:config
(load-theme 'modus-vivendi t))
(use-package dired
:ensure nil
:custom
(dired-use-ls-dired nil))
(line-number-mode 1)
(column-number-mode 1)
(show-paren-mode 1)
(setq-default indicate-empty-lines nil)
(setq-default indicate-buffer-boundaries nil)
(setq-default fringe-indicator-alist nil)
(ss-ui--setup-modeline)
(ss-ui--setup-completion)
(ss-ui--setup-writing-layout))
(provide 'ss-ui)
;;; ss-ui.el ends here
|