-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.el
140 lines (114 loc) Β· 3.1 KB
/
init.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
;; -*- lexical-binding: t; -*-
;;; init.el --- iykyk
;;; commentary:
;;; code:
(load (concat user-emacs-directory "lisp/dirt.el"))
(shut-up-load (~e "lisp/forest.el"))
(defun ns/summon (confs)
(->> confs
(-map '-list)
(-remove
(-lambda ((f . enables))
(when enables
(-any-p (fn (null (symbol-value <>))) enables))))
(--map (intern (format "ns/conf-%s" (first (-list it)))))
(-map 'funcall)))
;; alias to signal intent -- layers I don't use but might be nice for reference later
(setq ns/outdated nil)
(defun ns/conf-core ()
(ns/summon
`(
resources
sanity
evil
minibuffer
interface
buffers-and-windows
dired
editing
shell
projectile
util
git
server
org org-capture org-pim org-pim-export
follow-dwim
)))
(defun ns/conf-extra ()
(ns/summon
`(
corfu
flycheck
(dashdocs nil)
(restclient ns/outdated)
(latex ns/enable-home-p)
search-engines
(blog ns/enable-home-p)
scripting
funtext
rice-integrations
(pdf ns/enable-linux-p)
(ledger ns/outdated)
(filehooks ns/enable-home-p)
(macos-integrations ns/enable-mac-p)
(irc ns/enable-home-p)
graphviz)))
(defun ns/conf-development ()
(ns/summon
`(
clojure
elisp
go
sql
(c ns/outdated)
(common-lisp ns/outdated)
(javascript ns/outdated)
(typescript ns/outdated)
(python ns/outdated)
(plantuml ns/outdated)
markdown adoc
minor-langs
;; keep after $langs on purpose
lsp
)))
(if (getenv "NS_EMACS_BATCH")
;; doing a batch job, eval some lisp, message the result
(progn
(ns/conf-scripting)
(let ((result (-> "NS_EMACS_BATCH" getenv read eval pr-str)))
(message "COOL_DELIMITER")
(message result))
;; (-> "NS_EMACS_BATCH" getenv read eval pr-str message)
(kill-emacs))
;; normal MO:
(ns/conf-core)
(ns/conf-extra)
(ns/conf-development)
(ns/conf-staging)
(ns/check-for-orphans)
(ns/conf-style)
(message "πππ init sequence complete πππ")
(defun! ns/initial-startup-hook ()
(when (not (boundp 'ns/after-init-hook))
(setq ns/after-init-hook t)
;; Emacs is terribly slow on windows
(ns/toggle-bloat-global (not ns/enable-windows-p))
;; todo: sometimes this is annoying
(named-timer-idle-run :garbage-collect 2 t 'garbage-collect)
(->> recentf-list
(-filter (fn
(and
;; tramp slow
(not (file-remote-p <>))
(not (s-ends-with-p "recentf" <>))
(f-exists-p <>))))
(-take 6)
(mapc 'find-file))
(when (f-exists-p (~ "extend.el"))
(load (~ "extend.el")))
(funcall-interactively 'ns/load-theme (intern (get-resource "emacs.theme")))))
;; (add-hook 'emacs-startup-hook 'ns/initial-startup-hook)
(run-at-time 0.1 nil 'ns/initial-startup-hook)
)
(provide 'init)
;;; init.el ends here