-
Notifications
You must be signed in to change notification settings - Fork 30
/
early-init.el
80 lines (66 loc) · 2.45 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 --- Early Init File -*- lexical-binding: t; no-byte-compile: t -*-
(defvar bg--init-load-path load-path)
;; redirect eln cache
(when (fboundp 'startup-redirect-eln-cache)
(startup-redirect-eln-cache
(convert-standard-filename
(expand-file-name ".local/var/eln-cache/" user-emacs-directory))))
;; let's unset this variable and reset after emacs has started
(defvar bg--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 bg--file-name-handler-alist)
(makunbound 'bg--file-name-handler-alist)))
;; we wanna go straight this time!
(setq package-enable-at-startup nil)
(setq package-quickstart nil)
;; defer GC to much later to speed up the startup process
(setq gc-cons-threshold most-positive-fixnum
read-process-output-max 16777216
gc-cons-percentage 0.6)
(add-hook 'emacs-startup-hook
(lambda ()
;; restore after startup
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1)))
;; prevent the glimpse of unstyled UI elements
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
;; get rid of the title bar
(push '(undecorated-round . t) default-frame-alist)
;; initial starting position
(push '(height . 43) default-frame-alist)
(push '(width . 130) default-frame-alist)
(push '(left . 70) default-frame-alist)
(push '(top . 30) default-frame-alist)
;; disable all GUI elements
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; sane defaults
(setq inhibit-splash-screen t
initial-scratch-message nil
use-file-dialog nil
ring-bell-function #'ignore
echo-keystrokes 1e-6
comp-deferred-compilation nil
native-comp-async-report-warnings-errors nil
debug-on-error t
;; better scrolling
scroll-step 1
scroll-conservatively 101
scroll-preserve-screen-position 1
mouse-wheel-scroll-amount '(1 ((shift) . 5))
mouse-wheel-follow-mouse t
;; lines between the cursor and the edge of the screen
scroll-margin 3
;; wrap lines that are too long.
truncate-lines nil
;; don't resize frames a character at a time, but use pixels
frame-resize-pixelwise t
cursor-in-non-selected-windows nil
site-run-file nil
system-time-locale "en_US.utf8")
;;; early-init.el ends here