-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.el
105 lines (79 loc) · 2.79 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
;;; init.el --- Petmacs configurations -*- lexical-binding: t no-byte-compile: t -*-
;; Defer garbage collection further back in the startup process
(setq gc-cons-threshold most-positive-fixnum)
;; Don't pass case-insensitive to `auto-mode-alist'
(setq auto-mode-case-fold nil)
(unless (or (daemonp) noninteractive init-file-debug)
;; Suppress file handlers operations at startup
;; `file-name-handler-alist' is consulted on each call to `require' and `load'
(let ((old-value file-name-handler-alist))
(setq file-name-handler-alist nil)
(set-default-toplevel-value 'file-name-handler-alist file-name-handler-alist)
(add-hook 'emacs-startup-hook
(lambda ()
"Recover file name handlers."
(setq file-name-handler-alist
(delete-dups (append file-name-handler-alist old-value))))
101)))
;; Load path
;; Optimize: Force "lisp"" and "site-lisp" at the head to reduce the startup time.
(defun update-load-path (&rest _)
"Update `load-path'."
(dolist (dir '("site-lisp" "lisp"))
(push (expand-file-name dir user-emacs-directory) load-path)))
(defun add-subdirs-to-load-path (&rest _)
"Add subdirectories to `load-path'.
Don't put large files in `site-lisp' directory,
Otherwise the startup will be very slow."
(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)
(require 'init-custom)
(require 'init-funcs)
(require 'init-package)
(require 'init-basic)
(require 'init-font)
(require 'init-evil)
(require 'init-tools)
(require 'init-ui)
(require 'init-highlight)
(require 'init-dashboard)
(require 'init-ibuffer)
(require 'init-window)
(require 'init-treemacs)
;; (require 'init-workspace)
(if (equal petmacs-checker 'flycheck)
(require 'init-flycheck)
(require 'init-flymake))
(require 'init-vcs)
(require 'init-projectile)
(require 'init-project)
(require 'init-dired)
(require 'init-shell)
(require 'init-yasnippet)
(require 'init-consult)
(when (petmacs-treesit-available-p)
(require 'init-treesit))
(require 'init-corfu)
(cond ((equal petmacs-lsp-mode-impl 'eglot)
(require 'init-eglot))
(t
(require 'init-lsp)))
(cond ((and (equal petmacs-dap-mode-impl 'dape) emacs/>=29p)
(require 'init-dape))
(t
(require 'init-dap)))
(require 'init-elisp)
(require 'init-c-c++)
(require 'init-python)
(require 'init-java)
(require 'init-markdown)
;; (require 'init-golang)
;; (require 'init-scala)
;; (require 'init-web)
(require 'init-org)
(require 'init-keybindings)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init.el ends here