-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathearly-init.el
80 lines (65 loc) · 2.74 KB
/
early-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
;;; early-init.el -*- lexical-binding: t; -*-
;; Performance
(setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.5)
(setq inhibit-compacting-font-caches t)
(setq frame-inhibit-implied-resize t)
(setq read-process-output-max (* 64 1024)) ; 64kb
(defvar +file-name-handler-alist file-name-handler-alist)
(setq file-name-handler-alist nil)
(add-hook 'emacs-startup-hook
(lambda ()
(setq file-name-handler-alist +file-name-handler-alist)))
(setq package-enable-at-startup nil)
(setq load-prefer-newer t)
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
(push '(internal-border-width . 16) default-frame-alist)
;; Define packages
(defconst emacs-dir (file-truename user-emacs-directory)
"The currently loaded .emacs.d directory.")
(defconst emacs-local-dir (concat emacs-dir ".local/")
"Root directory for local storage. Do not share across systems.")
(defconst emacs-cache-dir (concat emacs-local-dir "cache/")
"Directory for volatile local storage.")
(defconst emacs-etc-dir (concat emacs-local-dir "etc/")
"Directory for non-volatile local storage")
(defconst emacs-packages-dir (concat emacs-local-dir "packages/")
"Where pacakges are stored.")
;; Package management
(setq straight-base-dir emacs-local-dir)
(defvaralias 'comp-deferred-compilation-deny-list 'comp-deferred-compilation-black-list)
;; The following speeds up init time by almost a second, but is likely a hack.
;;See https://www.gitmemory.com/issue/raxod502/straight.el/373/491018643
(setq straight-check-for-modifications '(check-on-save))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" straight-base-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-use-package-by-default t)
(straight-use-package 'use-package)
(use-package use-package-ensure-system-package)
(use-package modus-themes
:config
(load-theme 'modus-operandi t))
;; Hide default mode-line
(use-package hide-mode-line
:init
(hide-mode-line-mode 1))
(setq inhibit-message nil
warning-minimum-level :error
debug-on-error t)
(add-hook 'emacs-startup-hook (lambda ()
(interactive)
(setq inhibit-message nil
warning-minimum-level :warning
debug-on-error nil)))