-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
127 lines (102 loc) · 2.87 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
; vim:et
; we need these options before any other elisp code
(setq max-specpdl-size 3200)
(setq max-lisp-eval-depth 3200)
(setq debug-on-error t)
; hide stuff during loading
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(setq-default mode-line-format nil)
; config reloading
(global-set-key (kbd "<f5>")
(lambda ()
(interactive)
(load-file user-init-file)))
; cache folder
(mkdir (concat (file-truename user-emacs-directory) "cache/") :parents)
; {{{ straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
; integrate with use-package
(straight-use-package 'use-package)
(use-package straight :custom (straight-use-package-by-default t))
; always ensure
(setq use-package-always-ensure t)
; }}}
; {{{ GCMH
(use-package gcmh
:straight (gcmh :host gitlab :repo "koral/gcmh")
:demand t
:config
(gcmh-mode 1))
; }}}
; {{{ helper functions
(setq customcolors
'(bg1 "#2b3339"
bg2 "#323c41"
bg3 "#3a454a"
bg4 "#445055"
fg1 "#d3c6aa"
fg2 "#859289"
red "#e67e80"
orange "#e69875"
yellow "#dbbc7f"
green "#a7c080"
aqua "#83c092"
blue "#7fbbb3"
purple "#d699b6"
visual "#503946"
bg-red "#4e3e43"
bg-green "#404d44"))
; get a color
(defun getcol (name) (plist-get customcolors name))
; get a file path relative to the config folder
(defun get-cfg-path (&rest paths) (apply #'concat (file-truename user-emacs-directory) paths))
; load a config
(defun loadcfg (file) (load (concat (expand-file-name file (get-cfg-path "cfg/")) ".el")))
; define or set faces, akin to custom-set-faces
(defun custom-defset-faces (&rest args)
(progn
(dolist (pair args)
(let ((face (car pair)))
(if (not (facep face)) (defface face '() "Defined via custom-defset-faces"))))
(apply #'custom-set-faces args)))
; }}}
; {{{ packages & config
; some minor tweak packages (e.g. visual-fill-column) are under cfg/misc.el instead
; {{{ general.el
(use-package general)
(general-create-definer defkm
:keymaps 'override)
(general-create-definer ldr-defkm
:states '(normal insert emacs)
:keymaps 'override
:prefix "SPC"
:non-normal-prefix "M-SPC")
; }}}
; all ui packages (nano-theme, nano-modeline, etc.)
(loadcfg "pkgs/ui")
; evil
(loadcfg "pkgs/evil")
; ivy & related
(loadcfg "pkgs/ivy")
; org
(loadcfg "pkgs/org")
; misc packages
(loadcfg "pkgs/misc")
; }}}
; base emacs config
(loadcfg "misc")
(loadcfg "faces")
(loadcfg "keymaps")