This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
init.el
147 lines (120 loc) · 2.99 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
;;; -*- lexical-binding: t -*-
;;; general global variables for configuration
;; base load path
(defconst dotfiles-dir
(file-name-directory
(or (buffer-file-name) load-file-name))
"Base path for customised Emacs configuration")
(add-to-list 'load-path dotfiles-dir)
;; start a server, unless one is already running
(when (require 'server nil t)
(unless (server-running-p)
(server-start)))
;; What OS/window system am I using?
;; Adapted from:
;; https://github.com/purcell/emacs.d/blob/master/init.el
(defconst *is-a-mac*
(eq system-type 'darwin)
"Is this running on OS X?")
(defconst *is-carbon-emacs*
(and *is-a-mac* (eq window-system 'mac))
"Is this the Carbon port of Emacs?")
(defconst *is-cocoa-emacs*
(and *is-a-mac* (eq window-system 'ns))
"Is this the Cocoa version of Emacs?")
(defconst *is-linux*
(eq system-type 'gnu/linux)
"Is this running on Linux?")
;; Basic paths and variables other things need
(require 'init-utils)
(require 'init-paths)
;; backups and autosaves
(require 'init-backups)
;; Editing and interface changes
(require 'init-editing)
(require 'init-interface)
;; all external libraries and ELPA
(require 'init-packaging)
;; use-package - used in other places
(require 'init-use-package)
;; Platform specific configuration
(use-package init-window-gui
:if (display-graphic-p))
(use-package init-osx
:if *is-a-mac*)
(use-package init-linux
:if *is-linux*)
(use-package init-xterm
:if (not (display-graphic-p)))
;; Mode configuration
;; built-in modes
(defconst core-modes
'(init-abbrev
init-ansi-color
init-ansi-term
init-conf
init-ediff
init-emacs-lisp
init-eshell
init-flymake
init-hippie-expand
init-ido
init-isearch
init-org
init-python
init-recentf
init-rst
init-ruby
init-saveplace
init-tramp
init-uniquify)
"Configuration for core Emacs packages")
(bw-require-list core-modes)
;; vendor-ised modes
(defconst vendor-modes
'(init-json)
"Configuration for vendorised code")
(bw-require-list vendor-modes)
;; Packaged modes from ELPA etc.
(defconst elpa-modes
'(init-ace-jump
init-ack-and-a-half
init-ag
init-browse-kill-ring
init-csv-mode
init-enh-ruby
init-eproject
init-evil
init-expand-region
init-flx
init-go
init-ido-ubiquitous
init-ido-vertical
init-idomenu
init-iedit
init-js2
init-linum-relative
init-magit
init-markdown
init-multiple-cursors
init-paredit
init-puppet
init-scss
init-smex
init-undo-tree
init-web-mode
init-yaml
init-yasnippet)
"Configuration for modes loaded via package.el")
(bw-require-list elpa-modes)
;; Custom theme support
(require 'init-themes)
(require 'init-keybindings)
;; local overrides
(require 'init-local)
;; Load custom file last
(setq custom-file (concat dotfiles-dir "custom.el"))
(load custom-file 'noerror)
;; make sure we run the init hooks even if we didn't get a proper init
(when after-init-time
(run-hooks 'after-init-hook))