-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.el
More file actions
69 lines (51 loc) · 2.4 KB
/
init.el
File metadata and controls
69 lines (51 loc) · 2.4 KB
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
;;; init.el --- -*- lexical-binding: t; -*-
;; Copyright (C) 2020
;; Author: 7ym0n.q6e <bb.qnyd@gmail.com>
;; Keywords:
;; 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:
;; Defer garbage collection further back in the startup process
(setq gc-cons-threshold most-positive-fixnum)
;; Speed up startup
(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)
(put 'file-name-handler-alist 'initial-value old-value)
(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)))
;; (setq user-emacs-directory (expand-file-name "lisp" load-file-name))
;; (add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
(defun custom-config-load-path (&rest _)
"Load lisp path"
(dolist (dir '("lisp" "site-lisp"))
(push (expand-file-name dir 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 #'custom-config-load-path)
(advice-add #'package-initialize :after #'add-subdirs-to-load-path)
(custom-config-load-path)
;; Load the heart of dotfairy
(require 'init-startup)
(require 'custom-keybinds)
;;; init.el ends here