-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
79 lines (61 loc) · 2.7 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
;;; init.el --- bootstrap emacs
;;
;; Copyright 2017 Tracy Phillips
;;
;; 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 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, write to the Free Software Foundation,
;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;;; Commentary:
;; This is my Emacs init.el. There are many like it, but this one is mine.
;;; Code:
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(defvar root-dir (file-name-directory load-file-name)
"Emacs root configuration directory.")
(defvar core-dir (expand-file-name "core" root-dir)
"Emacs core configuration directory.")
(defvar core-data-dir (expand-file-name "data" root-dir)
"Local configuration data directory.")
(if (not (file-exists-p core-data-dir))
(make-directory core-data-dir t))
(defvar core-packages-dir (expand-file-name "packages" root-dir)
"Use-package configuration directory.")
(defvar core-utils-dir (expand-file-name "utilities" root-dir)
"Emacs helper utilities.")
(defvar core-local-dir (expand-file-name "local" root-dir)
"Local Emacs configuration data.")
(defvar core-vendor-dir (expand-file-name "vendor" root-dir)
"Manual package installation directory.")
;; Taken directly from Emacs Prelude. Thanks Bozhidar Batsov!
(defun core-add-subfolders-to-load-path (parent-dir)
"Add all PARENT-DIR subdirs to 'load-path'."
(dolist (f (directory-files parent-dir))
(let ((name (expand-file-name f parent-dir)))
(when (and (file-directory-p name)
(not (string-prefix-p "." f)))
(add-to-list 'load-path name)
(core-add-subfolders-to-load-path name)))))
(add-to-list 'load-path core-dir)
(add-to-list 'load-path core-packages-dir)
;; Vendor files are packages that are not available via MELPA, et al.
(core-add-subfolders-to-load-path (expand-file-name "vendor" root-dir))
;; Local configuration
(core-add-subfolders-to-load-path core-local-dir)
(require 'core)
(require 'core-shell)
;;; init.el ends here