-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathearly-init.el
143 lines (100 loc) · 3.88 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
;;; early-init.el --- Early init file -*- lexical-binding: t; -*-
;; Copyright (C) 2024, 2025 Zhengyi Fu
;; Author: Zhengyi Fu <[email protected]>
;; Keywords: local
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
;;;; gc
(setq gc-cons-threshold 25600000)
(setq load-prefer-newer t)
;;;; pre-early-init
(defvar pre-early-init-file (locate-user-emacs-file "pre-early-init.el")
"The file to load before `early-init'.")
(when (file-exists-p pre-early-init-file)
(load pre-early-init-file nil t))
(setq package-enable-at-startup nil)
(setq straight-use-version-specific-build-dir t)
(setq straight-enable-use-package-integration t)
(defvar straight-current-profile)
(setq straight-current-profile nil)
(setq straight-profiles '((nil . "default.el")
(dotemacs . "dotemacs.el")
(user . "user.el")
(custom . "custom.el")))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7)
(straight-current-profile nil))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(setq straight-default-files-directive
(seq-union straight-default-files-directive
'("docs/dir" "docs/*.info" "docs/*.texi" "docs/*.texinfo")))
(let ((straight-current-profile 'dotemacs))
(load (locate-user-emacs-file "packages.el") nil t))
;;;; site lisp
(add-to-list 'load-path (locate-user-emacs-file "site-lisp"))
(add-to-list 'load-path (locate-user-emacs-file "site-lisp/tui"))
(eval-when-compile (require 'dotemacs-core))
;;;; emacs core
(setq-default cursor-in-non-selected-windows nil)
(setq highlight-nonselected-windows nil)
(setq inhibit-compacting-font-caches t)
(setq use-file-dialog nil)
(setq system-time-locale "C")
(setq bidi-paragraph-direction 'left-to-right
bidi-inhibit-bpa t)
;; workaround WSL wayland clipboard issue
(setq select-active-regions nil)
(setq save-interprogram-paste-before-kill t)
(setq menu-bar-mode nil)
(setq tool-bar-mode nil)
(setq inhibit-default-init t
inhibit-splash-screen t)
(setq default-frame-alist `((vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil)))
(setq auto-save-no-message t)
;;;; files
(setq confirm-kill-emacs 'y-or-n-p)
(setq version-control t
delete-old-versions t
kept-old-versions 9
kept-new-versions 9)
;;;; startup
;; Disable loading of the `site-start' file.
(setq site-run-file nil)
;;;; custom
(setq custom-file (locate-user-emacs-file "custom.el"))
;;;; post-early-init
(defvar post-early-init-file (locate-user-emacs-file "post-early-init.el")
"The file to load after `early-init'.")
(when (file-exists-p post-early-init-file)
(let ((straight-current-profile 'user))
(load post-early-init-file nil t)))
(provide 'early-init)
;; Local Variables:
;; indent-tabs-mode: nil
;; no-byte-compile: t
;; End:
;;; early-init.el ends here