-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.el
97 lines (74 loc) · 2.58 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
;;; init.el --- Emacs start file -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Emacs start-up configuration.
;;
;;; Code:
(setopt user-init-file (or load-file-name buffer-file-name))
(setopt user-emacs-directory (file-name-directory user-init-file))
(defconst my-config-d (file-name-as-directory
(expand-file-name "etc" user-emacs-directory))
"Directory of configuration files.")
(defconst my-library-d (file-name-as-directory
(expand-file-name "lib" user-emacs-directory))
"Directory of packages.")
(defconst my-optional-d (file-name-as-directory
(expand-file-name "opt" user-emacs-directory))
"Directory of optional files.")
(defconst my-cache-d (file-name-as-directory
(expand-file-name "var" user-emacs-directory))
"Directory of dotfiles created by packages.")
(unless (file-directory-p my-cache-d) (mkdir my-cache-d))
(let ((old-file-name-handler-alist file-name-handler-alist)
(old-gc-cons-threshold gc-cons-threshold))
(setq file-name-handler-alist nil)
(setq gc-cons-threshold most-positive-fixnum)
(add-hook 'emacs-startup-hook
(lambda ()
"Speed up startup."
(setq file-name-handler-alist
(delete-dups (append file-name-handler-alist
old-file-name-handler-alist)))
;; If x10, half of cpu time is spent on gc when scrolling.
(setq gc-cons-threshold (* 100 old-gc-cons-threshold)))))
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
(load
(setopt custom-file (expand-file-name "custom.el" user-emacs-directory))
t t)
(require 'init-utils)
(require 'init-modeline)
(require 'init-funcs)
(require 'init-dired)
(require 'init-org)
(require 'init-ibuffer)
(when (display-graphic-p)
(require 'init-gui))
(require 'init-package)
(require 'init-edit)
(require 'init-vc)
;; (require 'init-ido)
(require 'init-vertico)
(require 'init-corfu)
(require 'init-prog)
(require 'init-check)
;; Handy tools though not must have.
(require 'init-misc)
(require 'init-reader)
(require 'init-evil)
(require 'init-markup)
(require 'init-snippet)
;; Program.
(require 'init-sexp)
(require 'init-frontend)
(require 'init-lsp)
;; Personal setup.
(load (expand-file-name "~/.custom.el") t nil)
(message "Emacs ready in %s with %d garbage collections."
(format "%.2f seconds"
(float-time
(time-subtract after-init-time before-init-time)))
gcs-done)
;; Local Variables:
;; coding: utf-8
;; End:
;;; init.el ends here