-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.el
84 lines (67 loc) · 2.41 KB
/
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
81
82
83
84
;;; init.el -*- lexical-binding: t; -*-
;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
;; to skip the mtime checks on every *.elc file.
(setq load-prefer-newer noninteractive)
(defvar albert-dumped nil
"non-nil when a dump file is loaded (because dump.el sets this variable).")
(defmacro albert-if-dump (then &rest else)
"Evaluate IF if running with a dump file, else evaluate ELSE."
(declare (indent 1))
`(if albert-dumped
,then
,@else))
(albert-if-dump
(progn
(message "Using pdump to start emacs...")
(setq load-path albert-dumped-load-path)
(global-font-lock-mode)
(add-hook 'after-init-hook
(lambda ()
(save-excursion
(switch-to-buffer "*scratch*")
(fundamental-mode)))))
;; add load-path’s and load autoload files
(package-initialize))
(when window-system
(albert-if-dump
(enable-theme 'doom-deeper-blue)))
(require 'benchmark-init)
;; Load path
;; Optimize: Force "lisp"" and "site-lisp" at the head to reduce the startup time.
(defun update-load-path (&rest _)
"Update `load-path'."
(push (expand-file-name "site-lisp" user-emacs-directory) load-path)
(push (expand-file-name "lisp" user-emacs-directory) load-path))
(defun add-subdirs-to-load-path (&rest _)
"Add subdirectories to `load-path'."
(let ((default-directory
(expand-file-name "site-lisp" user-emacs-directory)))
(normal-top-level-add-subdirs-to-load-path)))
;; (advice-add #'package-initialize :after #'update-load-path)
;; (advice-add #'package-initialize :after #'add-subdirs-to-load-path)
(update-load-path)
;; (setq comp-deferred-compilation t)
(require 'init-funcs)
(require 'init-core)
(require 'init-hydra)
(require 'init-editor)
(require 'init-ivy)
;; (require 'init-consult)
(require 'init-keybinds)
(require 'init-lang)
(require 'init-tools)
(require 'init-org)
;; (require 'init-keyfreq)
(require 'init-editor-paren)
(require 'init-ui)
(require 'init-ui-theme)
;; (require 'init-tree-sitter)
(require 'init-treesit)
;; (require 'init-lsp-bridge)
(require 'init-vcs)
;; maximize window
(if (or (eq system-type 'windows-nt) (eq system-type 'darwin) (eq window-system 'x))
(toggle-frame-maximized))
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
(load custom-file 'no-error 'no-message)