-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.el
76 lines (57 loc) · 2.61 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
;;; init.el --- My Emacs configuration
;;; Commentary:
;; Following lines load an Org file and build the configuration code out of it.
;;; Code:
(let ((gc-cons-threshold most-positive-fixnum)
(gc-cons-percentage 0.6))
;; Increase the amount of data which Emacs reads from the process
(setq read-process-output-max (* 1024 1024)) ;; 1mb
;; Silence compiler warnings as they can be pretty disruptive
(if (boundp 'comp-deferred-compilation)
(setq comp-deferred-compilation nil)
(setq native-comp-deferred-compilation nil))
;; Silence compiler warnings for deprecated packages
(setq byte-compile-warnings '(cl-functions))
;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
;; to skip the mtime checks on every *.elc file.
(setq load-prefer-newer noninteractive)
;; Set repositories
(require 'package)
(setq-default
load-prefer-newer t
package-enable-at-startup nil)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("elpa" . "https://elpa.gnu.org/packages/")))
;; Bootstrap straight.el
(setq straight-base-dir (expand-file-name "var" user-emacs-directory))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "var/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/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Make use-package use straight.el instead of package.el
(straight-use-package 'use-package)
;; Defer the loading of all packages, override with ":demand t"
(setq use-package-always-defer t)
;; Prevent package.el loading packages prior to their init-file loading.
(setq package-enable-at-startup nil)
;; Install org-mode
(straight-use-package 'org)
;; Tangle core configuration
(org-babel-load-file (expand-file-name "core.org" user-emacs-directory))
;; Tangle user configuration
(let ((userconfig-location (expand-file-name "config.org" user-emacs-directory)))
(when (file-exists-p userconfig-location)
(org-babel-load-file userconfig-location)))
(garbage-collect))
;;; init.el ends here