-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
51 lines (40 loc) · 1.98 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
;; -*- lexical-binding: t -*-
(let ((emacs-start-time (current-time)))
(add-hook 'emacs-startup-hook
(lambda ()
(let ((elapsed (float-time (time-subtract (current-time) emacs-start-time))))
(message "[Emacs initialized in %.3fs]" elapsed)))))
;; Disable byte-compile warnings
(setq byte-compile-warnings '(not obsolete))
(setq warning-suppress-log-types '((comp) (bytecomp)))
(setq native-comp-async-report-warnings-errors 'silent)
(setenv "PATH" (concat (expand-file-name "~/.local/bin") ":" (getenv "PATH")))
(add-to-list 'exec-path (expand-file-name "~/.local/bin"))
(setenv "PATH" (concat (expand-file-name "~/.asdf/shims") ":" (getenv "PATH")))
(add-to-list 'exec-path (expand-file-name "~/.asdf/shims"))
(let ((file-name-handler-alist nil)
(src-directory (concat user-emacs-directory "src/"))
(core-directory (concat user-emacs-directory "core/")))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(setq package-enable-at-startup nil)
(package-initialize)
(load (concat core-directory "prelude"))
(load (concat core-directory "config"))
(setq custom-file (concat user-emacs-directory "custom.el"))
(when (file-exists-p custom-file)
(load custom-file))
(cl-loop for file in (reverse (directory-files-recursively src-directory "\\.el$"))
do (condition-case ex
(load (file-name-sans-extension file))
('error (with-current-buffer "*scratch*"
(insert (format "[INIT ERROR]\n%s\n%s\n\n" file ex)))))))
;; Start server
(require 'server)
(unless (server-running-p)
(server-start))