-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathearly-init.el
62 lines (47 loc) · 2.11 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
;;; early-init.el -*- lexical-binding: t; -*-
;; Increase the GC threshold for faster startup
;; The default is 800 kilobytes. Measured in bytes.
(setq gc-cons-threshold (* 50 1000 1000))
;; Prefer loading newest compiled .el file
(customize-set-variable 'load-prefer-newer noninteractive)
;;; package configuration
(require 'package)
(require 'use-package-ensure)
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(customize-set-variable
'package-archive-priorities
'(("gnu" . 99) ; prefer GNU packages
("nongnu" . 80) ; use non-gnu packages if
; not found in GNU elpa
("stable" . 70) ; prefer "released" versions
; from melpa
("melpa" . 0))) ; if all else fails, get it
; from melpa
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
(setq use-package-always-ensure t)
(use-package diminish)
(use-package bind-key)
;; Native compilation settings
(when (featurep 'native-compile)
;; Silence compiler warnings as they can be pretty disruptive
(setq native-comp-async-report-warnings-errors nil)
;; Make native compilation happens asynchronously
(setq native-comp-deferred-compilation t)
;; Set the right directory to store the native compilation cache
;; NOTE the method for setting the eln-cache directory depends on the emacs version
(when (fboundp 'startup-redirect-eln-cache)
(if (version< emacs-version "29")
(add-to-list
'native-comp-eln-load-path
(convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory)))
(startup-redirect-eln-cache
(convert-standard-filename (expand-file-name "var/eln-cache/" user-emacs-directory)))))
(add-to-list 'native-comp-eln-load-path (expand-file-name "eln-cache/" user-emacs-directory)))
;; Make the initial buffer load faster by setting its mode to fundamental-mode
(customize-set-variable 'initial-major-mode 'fundamental-mode)
;; Always start maximized
(add-to-list 'default-frame-alist '(fullscreen . maximized))