-
Notifications
You must be signed in to change notification settings - Fork 1
/
early-init.el
43 lines (33 loc) · 1.62 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
;;; early-init.el -*- lexical-binding: t; -*-
;; mostly taken from doom emacs
(setq package-enable-at-startup nil)
(advice-add #'package--ensure-init-file :override #'ignore)
;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early.
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
(defvar default-gc-cons-threshold 16777216 ; 16mb
"my default desired value of `gc-cons-threshold'
during normal emacs operations.")
;; make garbage collector less invasive
(setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6)
(defvar default-file-name-handler-alist file-name-handler-alist)
(setq file-name-handler-alist nil)
;; reset the changes made here after the end of startup
(add-hook 'emacs-startup-hook
(lambda (&rest _)
(setq gc-cons-threshold default-gc-cons-threshold
gc-cons-percentage 0.1
file-name-handler-alist default-file-name-handler-alist)
;; delete no longer necessary startup variable
(makunbound 'default-file-name-handler-alist)))
;; Resizing the Emacs frame can be a terribly expensive part of changing the
;; font. By inhibiting this, we easily halve startup times with fonts that are
;; larger than the system default.
(setq frame-inhibit-implied-resize t)
;; disable async native compilation. Do it upfront instead of causing random slowdowns
(setq comp-deferred-compilation nil)
;; needs to be set before straight.el is loaded in order to fix
;; flycheck temp file creation
(setq straight-fix-flycheck t)