-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.el
145 lines (110 loc) · 4.31 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
;;; init.el --- Startup file for Emacs. -*- lexical-binding: t; -*-
;; Copyright (C) 2017 Jerry Peng
;; Author: Jerry Peng <[email protected]>
;;; Commentary:
;; The init system and the config structure are based on Chris
;; Barrett's amazing work: https://github.com/chrisbarrett/.emacs.d
;; Declares some variables and bootstraps the rest of the configuration.
;;
;; One main difference from other configurations out there is that I use git subtrees for
;; many core packages, instead of relying on the Emacs package manager.
;;; Code:
(setq gc-cons-threshold 100000000)
(defconst emacs-start-time (current-time))
(unless noninteractive
(message "Loading %s..." load-file-name))
(when (boundp 'comp-deferred-compilation)
(setq comp-deferred-compilation nil))
(defvar jp-emacs-cache-dir (expand-file-name ".emacs.d.cache/" "~/"))
(defvar jp-emacs-eln-cache-dir (expand-file-name "eln-cache" jp-emacs-cache-dir))
(defvar jp-emacs-undo-history-dir (expand-file-name "undo" jp-emacs-cache-dir))
(make-directory jp-emacs-eln-cache-dir t)
(make-directory jp-emacs-undo-history-dir t)
(defvar jp-straight-profile (expand-file-name "straight-pkgs.el" user-emacs-directory))
(defvar straight-base-dir)
(defvar straight-profiles)
(setq straight-base-dir jp-emacs-cache-dir)
(setq straight-profiles `((nil . ,jp-straight-profile)))
(defvar native-comp-eln-load-path)
(setq native-comp-eln-load-path (cons jp-emacs-eln-cache-dir (cdr native-comp-eln-load-path)))
;; Bootstrap straight.el package manager.
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" jp-emacs-cache-dir))
(bootstrap-version 5))
(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))
(setq straight-disable-native-compile nil)
;; Install some basic packages
(straight-use-package 'dash)
(straight-use-package 'f)
(straight-use-package 's)
(straight-use-package 'noflet)
(straight-use-package 'memoize)
(straight-use-package 'el-patch)
(with-no-warnings
(setq use-package-verbose t))
(straight-use-package 'use-package)
(eval-when-compile
(require 'use-package))
(require 'seq)
(require 'subr-x)
(defun jp-init/init-load-path (&optional interactive-p)
(interactive "p")
(let* ((before load-path)
(lisp-dir (expand-file-name "lisp" user-emacs-directory))
(config-dir (expand-file-name "config" user-emacs-directory)))
(dolist (path (list lisp-dir config-dir))
(add-to-list 'load-path path)
(add-to-list 'Info-default-directory-list path))
(setq load-path (seq-filter #'file-directory-p load-path))
(setq Info-default-directory-list (seq-filter #'file-directory-p Info-default-directory-list))
(when interactive-p
(if-let (added (seq-difference load-path before))
(message "Load path updated. Added: %S" added)
(message "No change to load-path")))))
(jp-init/init-load-path)
;; Load features.
(use-package jp-basic-settings)
(use-package jp-hydra)
(use-package jp-org)
(use-package jp-ui)
(use-package jp-base)
(use-package jp-smartparens)
(use-package jp-completion)
(use-package jp-flycheck)
(use-package jp-projectile)
(use-package jp-eyebrowse)
(use-package jp-magit)
(use-package jp-restclient)
(use-package jp-yasnippet)
(use-package jp-treemacs)
(use-package jp-bufler)
(use-package jp-elisp)
;; Programming language support
(use-package jp-prog)
;; Tools
(use-package jp-elfeed)
(use-package jp-org-roam)
(use-package jp-org-journal)
;;; 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))
(setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file)
(provide 'init)
;;; init.el ends here