forked from jamescherti/minimal-emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-early-init.el
More file actions
21 lines (17 loc) · 1.28 KB
/
pre-early-init.el
File metadata and controls
21 lines (17 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;;; ~/.emacs.d/pre-early-init.el --- This file is loaded before early-init.el. Use it for configurations that need to be set even earlier in the startup sequence, typically affecting the initial setup of the Emacs environment. -*- no-byte-compile: t; lexical-binding: t; -*-
;; Reducing clutter in ~/.emacs.d by redirecting files to ~/.emacs.d/var/
;; IMPORTANT: This part should be in the pre-early-init.el file
(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory))
(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir))
(setq user-emacs-directory minimal-emacs-var-dir)
;; By default, minimal-emacs-package-initialize-and-refresh is set to t, which
;; makes minimal-emacs.d call the built-in package manager. Since Elpaca will
;; replace the package manager, there is no need to call it.
(setq minimal-emacs-package-initialize-and-refresh nil)
(defun display-startup-time ()
"Display the startup time and number of garbage collections."
(message "Emacs init loaded in %.2f seconds (Full emacs-startup: %.2fs) with %d garbage collections."
(float-time (time-subtract after-init-time before-init-time))
(time-to-seconds (time-since before-init-time))
gcs-done))
(add-hook 'emacs-startup-hook #'display-startup-time 100)