-
Notifications
You must be signed in to change notification settings - Fork 269
/
init.el
160 lines (131 loc) · 4.47 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
;;; init.el --- A Fancy and Fast Emacs Configuration. -*- lexical-binding: t no-byte-compile: t -*-
;; Copyright (C) 2006-2024 Vincent Zhang
;; Author: Vincent Zhang <[email protected]>
;; URL: https://github.com/seagle0128/.emacs.d
;; Version: 8.1.0
;; Keywords: .emacs.d centaur
;;
;; `..`
;; ````+ `.`
;; /o:`` :+ ``
;; .+//dho......y/..`
;; `sdddddhysso+h` ``
;; /ddd+`..` +. .`
;; -hos+ `.:```
;; `./dddyo+//osso/:`
;; `/o++dddddddddddddod-
;; `// -y+:sdddddsddsy.dy
;; /o `..```h+`y+/h+`
;; .s `++``o: ``
;; `:- `:-
;;
;; CENTAUR EMACS - Enjoy Programming & Writing
;; 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, 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; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;
;;; Commentary:
;;
;; Centaur Emacs - A Fancy and Fast Emacs Configuration.
;;
;;; Code:
(when (version< emacs-version "27.1")
(error "This requires Emacs 27.1 and above!"))
;;
;; Speed up startup
;;
;; Defer garbage collection further back in the startup process
(setq gc-cons-threshold most-positive-fixnum)
;; Prevent flashing of unstyled modeline at startup
(setq-default mode-line-format nil)
;; 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, e.g. EAF.
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)
;; Requisites
(require 'init-const)
(require 'init-custom)
(require 'init-funcs)
;; Packages
;; Without this comment Emacs25 adds (package-initialize) here
(require 'init-package)
;; Preferences
(require 'init-base)
(require 'init-hydra)
(require 'init-ui)
(require 'init-edit)
(require 'init-completion)
(require 'init-snippet)
(require 'init-bookmark)
(require 'init-calendar)
(require 'init-dashboard)
(require 'init-dired)
(require 'init-highlight)
(require 'init-ibuffer)
(require 'init-kill-ring)
(require 'init-workspace)
(require 'init-window)
(require 'init-treemacs)
(require 'init-eshell)
(require 'init-shell)
(require 'init-markdown)
(require 'init-org)
(require 'init-reader)
(require 'init-dict)
(require 'init-docker)
(require 'init-player)
(require 'init-utils)
;; Programming
(require 'init-vcs)
(require 'init-check)
(require 'init-lsp)
(require 'init-dap)
(require 'init-prog)
(require 'init-elisp)
(require 'init-c)
(require 'init-go)
(require 'init-rust)
(require 'init-python)
(require 'init-ruby)
(require 'init-elixir)
(require 'init-web)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init.el ends here