forked from chrisbarrett/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
executable file
·184 lines (139 loc) · 4.97 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
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
;;; init.el --- Startup file for Emacs. -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(when (version< emacs-version "26")
(error "This version of Emacs is not supported"))
(setq gc-cons-threshold (* 800 1024))
(defconst emacs-start-time (current-time))
(unless noninteractive
(message "Loading %s..." load-file-name))
(setenv "INSIDE_EMACS" "true")
;; Make sure package.el doesn't get a chance to load anything.
(setq package-enable-at-startup nil)
;; Bootstrap straight.el package manager.
(eval-and-compile
(defvar bootstrap-version 5)
(defvar bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage)
(with-no-warnings
(setq straight-cache-autoloads t)
(setq straight-check-for-modifications '(watch-files)))
(require 'straight bootstrap-file t)
;; Install some basic packages
(straight-use-package 'dash)
(straight-use-package 'dash-functional)
(straight-use-package 'f)
(straight-use-package 's)
(straight-use-package 'noflet)
(straight-use-package 'memoize)
(straight-use-package 'general)
(straight-use-package 'el-patch)
(with-no-warnings
(setq use-package-verbose t))
(straight-use-package 'bind-map)
(straight-use-package 'use-package)
(eval-when-compile
(require 'use-package))
;; Load features.
(require 'paths (expand-file-name "paths.el" user-emacs-directory))
(paths-initialise)
(add-to-list 'custom-theme-load-path paths-themes-directory)
;; Ensure org-version hack is activated.
(require 'org-version (expand-file-name "org-version.el" paths-hacks-directory))
;; no-littering overrides many common paths to keep the .emacs.d directory
;; clean.
;;
;; Load it here since we want to refer to path vars, and need to make sure it's
;; loaded very early in the startup process.
(use-package no-littering
:straight t
:demand t
:init
(progn
(setq no-littering-etc-directory paths-etc-directory)
(setq no-littering-var-directory paths-cache-directory))
:config
(progn
(setq auto-save-file-name-transforms
`((".*" ,(f-join paths-cache-directory "auto-save") t)))
(eval-when-compile
(require 'recentf))
(with-eval-after-load 'recentf
(add-to-list 'recentf-exclude no-littering-etc-directory)
(add-to-list 'recentf-exclude no-littering-var-directory))))
;; Load theme aggressively, or Emacs will look ugly during the startup sequence.
(use-package config-themes
:commands (config-themes-set-for-time-of-day)
:demand t
:config
(add-hook 'before-make-frame-hook #'config-themes-set-for-time-of-day))
(use-package config-basic-settings)
(use-package config-darwin
:if (equal system-type 'darwin))
(use-package config-nixos
:if (and (equal system-type 'gnu/linux)
(string-match-p "nixos" (f-read "/proc/version"))))
(use-package config-modeline)
(use-package config-editing)
(use-package config-hydras)
(use-package config-evil)
(use-package config-ivy)
(use-package config-search)
(use-package config-projectile)
(use-package config-langs)
(use-package config-elisp)
(use-package config-smartparens)
(use-package config-git)
(use-package config-company)
(use-package config-yasnippet)
(use-package config-flycheck)
(use-package config-mu4e)
(use-package config-org)
(use-package config-ledger)
(use-package config-rust)
(use-package config-dired)
(use-package config-ibuffer)
(use-package config-web-mode)
(use-package config-markdown)
(use-package config-restclient)
(use-package config-haskell)
(use-package config-latex)
(use-package config-python)
(use-package config-nix)
(use-package config-etags)
(use-package config-treemacs)
(use-package config-eshell)
(use-package config-docker)
(use-package config-lsp)
(use-package config-java)
(use-package config-csharp)
(use-package personal-config
:load-path "~/Sync/personal-config")
(when (file-exists-p paths-hostfile)
(load-file paths-hostfile))
(unless user-full-name (warn "`user-full-name' not set"))
(unless user-mail-address (warn "`user-mail-address' not set"))
;;; Post init setup.
(unless (file-directory-p org-directory)
(when (y-or-n-p (format "`org-directory' does not exist. Create at %s? " org-directory))
(mkdir org-directory)))
;;; Print overall startup time.
(unless noninteractive
(let ((elapsed (float-time (time-subtract (current-time) emacs-start-time))))
(message "Loading %s...done (%.3fs)" load-file-name elapsed))
(add-hook 'after-init-hook
`(lambda ()
(let ((elapsed (float-time (time-subtract (current-time)
emacs-start-time))))
(message "Loading %s...done (%.3fs) [after-init]"
,load-file-name elapsed)))
t))
(provide 'init)
;;; init.el ends here