-
Notifications
You must be signed in to change notification settings - Fork 8
/
early-config.el
303 lines (255 loc) · 11.7 KB
/
early-config.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
;;; early-config.el --- User config for early init -*- lexical-binding: t; -*-
;; Copyright (C) 2022 Colin McLear
;; Author: Colin McLear <[email protected]>
;; Keywords: tools, convenience
;;; Frame & Colors
;; ;; Set colors correctly so there is no flash at startup
(cond ((string= (shell-command-to-string "dark-mode status") "on\n")
(setq active-theme 'dark-theme))
(t
(setq active-theme 'light-theme)))
(setq-default initial-frame-alist
(append (list
'(fullscreen . maximized)
`(background-color . ,(if (eq active-theme 'light-theme) "#fffefd" "#141414"))
`(foreground-color . ,(if (eq active-theme 'light-theme) "#141414" "#A3A3A3"))
'(internal-border-width . 12)
'(tool-bar-lines . 0)
'(vertical-scroll-bars . nil)
'(horizontal-scroll-bars . nil)
'(undecorated . nil))))
;; No modeline at startup
(setopt mode-line-format nil)
(setopt header-line-format nil)
;;;; Package settings
;; Don't auto ensure packages with use-package
(setopt lem-package-ensure-packages nil)
;;;; Package List
;; Explicitly set packages for download/install or removal
;; Needs to be set before package initialization
;; https://www.olivertaylor.net/emacs/notes-on-package-el.html
(setopt package-selected-packages '(;; utility
async
dash
s
f
el-patch
;; settings
visual-regexp
backup-walker
expand-region
;; functions
crux
;; macros
anaphora
macrostep
;; frames
ns-auto-titlebar
;; windows
ace-window
;; buffers
popper
revert-buffer-all
;; fonts
all-the-icons
all-the-icons-dired
all-the-icons-completion
;; faces
dimmer
goggles
highlight-numbers
hl-todo
outline-minor-faces
svg-tag-mode
;; completion
cape
consult
consult-dir
corfu
embark
embark-consult
kind-icon
marginalia
orderless
vertico
yasnippet
yasnippet-snippets
;; keybindings
which-key
;; navigation
imenu-list
goto-last-change
;; dired
dired-narrow
dired-quick-sort
diredfl
peep-dired
dired-ranger
;; search
deadgrep
rg
wgrep
visual-regexp-steroids
;; modal
meow
;; vc
magit
git-commit
diff-hl
vdiff-magit
;; tabs
tabspaces
;; help
hydra
helpful
elisp-demos
info-colors
;; colors
rainbow-mode
;; modeline
hide-mode-line
;; writing
binder
consult-flyspell
flyspell-correct
markdown-mode
markdown-toc
writeroom-mode
lorem-ipsum
palimpsest
auctex
define-word
osx-dictionary
visual-fill-column
;; citation
citeproc
citar
;; notes
denote
citar-denote
consult-notes
obsidian
;; programming
aggressive-indent
flymake-collection
elisp-def
embrace
highlight-indent-guides
iedit
multi-compile
package-lint
rainbow-delimiters
puni
treesit-auto
vimrc-mode
web-mode
php-mode
haskell-mode
applescript-mode
tldr
lua-mode
yaml-mode
rainbow-identifiers
auto-compile
esxml
kv
;; debug
bug-hunter
esup
;; shell
exec-path-from-shell
eat
;; eshell
pcmpl-homebrew
pcmpl-git
pcmpl-args
pcomplete-extension
esh-help
eshell-up
eshell-syntax-highlighting
;; org extensions
htmlize
org-autolist
org-appear
org-contrib
org-download
org-modern
org-pomodoro
ox-pandoc
ox-hugo
org-tree-slide
;; pdf
pdf-tools
org-noter
;; elfeed
elfeed
elfeed-tube
;; macos
reveal-in-osx-finder
grab-mac-link
osx-lib
;; mail
org-msg
mu4e-column-faces
;; other
command-log-mode
xwidgets-reuse))
;; Package vc list
(setq package-vc-selected-packages '((zotxt-emacs
:url "https://github.com/egh/zotxt-emacs.git"
:branch "master")
(bibtex-capf
:url "https://github.com/mclear-tools/bibtex-capf.git"
:branch "main")
(pulsing-cursor
:url "https://github.com/jasonjckn/pulsing-cursor"
:branch "main")
(org-devonthink
:url "https://github.com/lasvice/org-devonthink"
:branch "master")
(org-modern-indent
:url "https://github.com/jdtsmith/org-modern-indent")))
;; Auto install the required packages
;; Set missing package vars
(defvar lem-missing-packages '()
"List populated at startup containing packages needing installation.")
(defvar lem-missing-vc-packages '()
"List populated at startup containing vc packages requiring installation.")
;; Check for packages
(defun lem-check-missing-packages ()
"Check for missing packages."
(interactive)
;; Check packages
(message "%s" "Checking for missing packages.")
(dolist (p package-selected-packages)
(unless (package-installed-p p)
(add-to-list 'lem-missing-packages p 'append)))
;; Check vc installed packages (Emacs 29+)
(when (version< "29" emacs-version)
(message "%s" "Checking for missing vc packages.")
(dolist (p package-vc-selected-packages)
(unless (package-installed-p (car p))
(add-to-list 'lem-missing-vc-packages (car p) 'append)))))
;; Install packages
(defun lem-install-missing-packages ()
"Install missing packages from package & package-vc lists."
(interactive)
(lem-check-missing-packages)
(cond ((or lem-missing-packages
lem-missing-vc-packages)
(message "Refreshing package database & installing missing packages...")
(package-install-selected-packages t)
(setq lem-missing-packages '())
(package-vc-install-selected-packages)
(setq lem-missing-vc-packages '()))
(t
(message "No missing packages."))))
;; Don't show warnings
(setq warning-minimum-level :emergency)
;; Enable installed packages at startup
(setopt package-enable-at-startup t
;; Allow loading from the package cache
package-quickstart t)
;; Install packages if missing
(lem-install-missing-packages)
;;; early-config.el ends here