-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathinit.el
78 lines (65 loc) · 2.88 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
;; -*- lexical-binding: t -*-
(let ((emacs-start-time (current-time)))
(add-hook 'emacs-startup-hook
(lambda ()
(let ((elapsed (float-time (time-subtract (current-time) emacs-start-time))))
(message "[Emacs initialized in %.3fs]" elapsed)))))
(let ((gc-cons-threshold (* 256 1024 1024))
(file-name-handler-alist nil)
(core-directory (concat user-emacs-directory "core/"))
(bindings-directory (concat user-emacs-directory "bindings/"))
(config-directory (concat user-emacs-directory "config/")))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(unless (display-graphic-p) (menu-bar-mode -1))
(defgroup dotemacs nil
"Custom configuration for dotemacs."
:group 'local)
(defcustom dotemacs-cache-directory (concat user-emacs-directory ".cache/")
"The storage location for various persistent files."
:type 'directory
:group 'dotemacs)
(defcustom dotemacs-completion-engine
'corfu
"The completion engine the use."
:type '(radio
(const :tag "corfu" corfu)
(const :tag "company-mode" company)
(const :tag "auto-complete-mode" auto-complete))
:group 'dotemacs)
(defcustom dotemacs-switch-engine
'consult
"The primary engine to use for narrowing and navigation."
:type '(radio
(const :tag "helm" helm)
(const :tag "consult" consult)
(const :tag "ido" ido)
(const :tag "ivy" ivy))
:group 'dotemacs)
(defcustom dotemacs-pair-engine
'emacs
"The primary engine to use auto-pairing and parens matching."
:type '(radio
(const :tag "emacs" emacs)
(const :tag "smartparens" smartparens))
:group 'dotemacs)
(defcustom dotemacs-globally-ignored-directories
'("elpa" ".cache" "target" "dist" "node_modules" ".git" ".hg" ".svn" ".idea")
"A set of default directories to ignore for anything that involves searching."
:type '(repeat string)
:group 'dotemacs)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("gnu" . "https://elpa.gnu.org/packages/")))
(setq package-enable-at-startup nil)
(package-initialize)
(load (concat core-directory "core-boot"))
(setq custom-file (concat user-emacs-directory "custom.el"))
(when (file-exists-p custom-file)
(load custom-file))
(cl-loop for file in (append (reverse (directory-files-recursively config-directory "\\.el$"))
(reverse (directory-files-recursively bindings-directory "\\.el$")))
do (condition-case ex
(load (file-name-sans-extension file))
('error (with-current-buffer "*scratch*"
(insert (format "[INIT ERROR]\n%s\n%s\n\n" file ex)))))))