blob: 20f3a52747e9cd56c227d15662291a97bfba4008 (
plain)
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
|
;;; init.el --- .Emacs Configuration -*- lexical-binding: t -*-
;;; Commentary:
;;
;; Emacs!!!
;;; Code:
;; Without this comment emacs25 adds (package-initialize) here
;; (package-initialize)
;;; Time Mark
(setq emacs-load-start-time (current-time))
(setq package-check-signature 'allow-unsigned)
;;; Fix TLS emacs 26.x
(if (version<= emacs-version "26.2")
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
;;; Welcome message
(setq-default initial-scratch-message
(concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n"))
(defvar before-user-init-time (current-time)
"Value of `current-time' when Emacs begins loading `user-init-file'.")
;;; Garbage Collector
(progn
;; Set this to true to find GC issues.
(setq garbage-collection-messages nil)
;; Increase the gc-cons-threshold to a very high number to decrease
;; the load and compile time. The value will be decreased
;; significantly after initialization to avoid long GC pauses during
;; normal usage.
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
;; Reset GC to normal values.
(add-hook 'emacs-startup-hook
(lambda ()
(message
"[STARTUP] Loading %s...done (%.3fs)" user-init-file
(float-time (time-subtract (current-time)
before-user-init-time)))
(when init-file-debug
(message "Rolling back GC settings to sane values."))
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1))))
;;; Modules directory
(push (concat user-emacs-directory "modules") load-path)
;;;------------------------------
;;; Features
;;;------------------------------
;;; https://stackoverflow.com/questions/2816019/in-lisp-avoid-cannot-open-load-file-when-using-require
;; @see https://www.reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start/
;; Normally file-name-handler-alist is set to
;; (("\\`/[^/]*\\'" . tramp-completion-file-name-handler)
;; ("\\`/[^/|:][^/|]*:" . tramp-file-name-handler)
;; ("\\`/:" . file-name-non-special))
;; Which means on every .el and .elc file loaded during start up, it has to runs those regexps against the filename.
(let* ((file-name-handler-alist nil))
;; package-initialize' takes 35% of startup time
;; need check https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast for solution
(require 'init-security)
(require 'init-elpa)
;; theme
(require 'init-theme)
;; Utils
(require 'init-utils)
;; GUI
(require 'init-linum)
(require 'init-gui)
(require 'init-editing-utils)
(require 'init-diminish)
(require 'init-modeline)
(require 'init-indent-guides)
(require 'init-icons)
(require 'init-neotree)
(require 'init-dashboard)
;; Tools
(require 'init-apache)
(require 'init-company)
(require 'init-flycheck)
(require 'init-ivy)
(require 'init-log4j)
(require 'init-whitespace)
(require 'init-emmet-mode)
(require 'init-nginx)
(require 'init-git)
(require 'init-editorconfig)
;; Languages
(require 'init-ccc)
(require 'init-crystal)
(require 'init-html)
(require 'init-js-two)
(require 'init-markdown)
(require 'init-go)
(require 'init-php)
(require 'init-projectile)
(require 'init-python)
(require 'init-pkgbuild)
(require 'init-less)
(require 'init-lua)
(require 'init-smartparens)
(require 'init-sass)
(require 'init-scss)
(require 'init-typescript)
(require 'init-vue)
(require 'init-yaml)
;; Plus
(require 'init-rainbow)
(require 'init-web-mode)
(require 'init-dotenv)
(require 'init-dockerfile)
(require 'init-dokuwiki)
(require 'init-linter)
(require 'init-load-env-vars)
(require 'init-restclient)
(require 'init-terraform)
(require 'init-ox-reveal))
;;; Custom variables
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;;; Loads custom file
(when (file-exists-p custom-file)
(load custom-file))
;;; Settings
(setq settings-file (expand-file-name "settings.el" user-emacs-directory))
;;; Loads settings file
(when (file-exists-p custom-file)
(load settings-file))
;; enable erase-buffer command
(put 'erase-buffer 'disabled nil)
(provide 'init)
;; Local Variables:
;; byte-compile-warnings: (not free-vars)
;; End:
;;; init.el ends here
|