-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.el
62 lines (43 loc) · 1.69 KB
/
setup.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
;;; -*- lexical-binding: t -*-
;;* defvars
(defvar +setup-directory (expand-file-name "setup" +conf-directory))
(defvar +lib-directory (expand-file-name "lib" +conf-directory))
(defvar +misc-directory (expand-file-name "misc" +conf-directory))
(defvar +themes-directory (expand-file-name "themes" +conf-directory))
(defvar +init-setups
'(defaults
keybindings
evil
consult
prog-tools
ext-tools
simple-modes))
(defvar +misc-setups nil)
;;* load custom file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load-file custom-file))
;;* setup package
(defvar package-archives '(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("nongnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/nongnu/")
("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(setq package-quickstart t)
(require 'use-package-ensure)
(setq use-package-always-ensure t)
(use-package diminish)
;;* setup internal (lib) and external (elpa) packages
(add-to-list 'custom-theme-load-path +themes-directory)
(let ((lib-autoload (expand-file-name "lib-autoload.el" +lib-directory)))
(add-to-list 'load-path +lib-directory)
(unless (file-exists-p lib-autoload)
(make-directory-autoloads +lib-directory lib-autoload))
(load-file lib-autoload))
;;* load *-setup
(defun +setup-path (name directory)
(when (symbolp name)
(setq name (symbol-name name)))
(expand-file-name (concat name "-setup.el") directory))
(dolist (setup +init-setups)
(load-file (+setup-path setup +setup-directory)))
(dolist (setup +misc-setups)
(load-file (+setup-path setup +misc-directory)))