-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
137 lines (113 loc) · 4.62 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
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
;;; init.el --- Initialize Emacs. -*- lexical-binding: t; -*-
;; This file is not part of GNU Emacs.
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Kwatz!
;;; Code:
(defconst emacs-start-time (current-time))
(when (version< emacs-version "26")
(error (concat "At least emacs 26 is required. Currently running: " emacs-version)))
(setq package-enable-at-startup nil
read-process-output-max (* 1024 1024)
gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.7
garbage-collection-messages nil
max-specpdl-size 10000 ;; Needed for stream.el
message-log-max 16384)
(custom-set-variables
'(menu-bar-mode . nil)
'(tool-bar-mode . nil)
'(scroll-bar-mode . nil))
(modify-all-frames-parameters
'((vertical-scroll-bars) (name . "Emacs")))
(set-face-attribute 'mode-line nil :box nil)
(setq initial-frame-alist '((name . "")))
(setq frame-resize-pixelwise t
inhibit-startup-screen t
inhibit-startup-echo-area-message (user-login-name)
inhibit-startup-message t
initial-scratch-buffer nil)
(toggle-frame-maximized)
(unless noninteractive
(message "Loading %s..." load-file-name))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(with-no-warnings
(setq use-package-verbose t))
(eval-when-compile
(require 'use-package)
(require 'bind-key)
(require 'seq)
(require 'subr-x)
(with-no-warnings
(require 'cl-lib)))
(use-package f :straight t :commands (f-exists? f-expand f-traverse-upwards))
(use-package s :straight :commands (s-trim))
(use-package anaphora :straight t :commands (alambda alet awhen))
(use-package vmacs-paths :load-path "layers")
(use-package vmacs-core)
(use-package vmacs-darwin :if (equal system-type 'darwin))
(use-package vmacs-linux :if (equal system-type 'gnu/linux))
(seq-doseq (feature
(seq-reduce (lambda (acc it)
(let ((layer (file-name-base it))
(exclude-layers
'("vmacs-core"
"vmacs-paths"
"vmacs-darwin"
"vmacs-linux")))
(if (not (member layer exclude-layers))
(cons (intern layer) acc)
acc)))
(directory-el vmacs-layers) nil))
(eval `(use-package ,feature)))
;;; --- Post-init
(progn
(when (member (expand-file-name "~/.emacs.d") load-path)
(setq load-path (remove (expand-file-name "~/.emacs.d") load-path)))
(setq load-path (delete-dups load-path)))
(defvar config-default-gc-threshold (* 1024 1024 100))
(defun config--inhibit-gc ()
"Inhibit garbage collection."
(setq gc-cons-threshold most-positive-fixnum))
(defun config--enable-gc ()
"Enable garbage collection."
(setq gc-cons-threshold config-default-gc-threshold
garbage-collection-messages t))
(add-hook 'minibuffer-setup-hook #'config--inhibit-gc)
(add-hook 'minibuffer-exit-hook #'config--enable-gc)
(add-hook 'after-init-hook #'config--enable-gc)
(when window-system
(let ((elapsed (float-time (time-subtract
(current-time) emacs-start-time))))
(message "Loading %s...done (%.3fs)" load-file-name elapsed))
(add-hook 'after-init-hook
`(lambda ()
(let ((elapsed (float-time (time-subtract
(current-time) emacs-start-time))))
(message "Loading %s...done (%.3fs) [after-init]"
,load-file-name elapsed)))
t))
;;; init.el ends here
;; Local Variables:
;; no-byte-compile: t
;; End: