-
Notifications
You must be signed in to change notification settings - Fork 22
/
init.el
83 lines (66 loc) · 2.72 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
;; ---------------------------------------------------
;; Sample emacs config focusing on clojure development
;; ---------------------------------------------------
;; installed packages
;; - exec-path-from-shell (not from stable!)
;; - hl-sexp
;; - paredit
;; - clojure-mode
;; - cider
;; - company
;; - flycheck (not from stable!)
;; - flycheck-clojure
;; - clj-refactor
;; Add .emacs.d/lisp to load-path
(setq dotfiles-lisp-dir
(file-name-as-directory
(concat (file-name-directory
(or (buffer-file-name) load-file-name))
"lisp")))
(add-to-list 'load-path dotfiles-lisp-dir)
;; don't use tabs for indent
(setq-default indent-tabs-mode nil)
;; emacs package management
;; use MELPA stable
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
(setq package-user-dir (concat user-emacs-directory "elpa"))
(add-to-list 'load-path (concat user-emacs-directory "site-lisp"))
(defun require-package (package &optional min-version no-refresh)
"Install given PACKAGE, optionally requiring MIN-VERSION.
If NO-REFRESH is non-nil, the available package lists will not be
re-downloaded in order to locate PACKAGE."
(if (package-installed-p package min-version)
t
(if (or (assoc package package-archive-contents) no-refresh)
(package-install package)
(progn
(package-refresh-contents)
(require-package package min-version t)))))
(setq package-enable-at-startup nil) ; Don't initialize later as well
(package-initialize)
;; show opening, closing parens
(show-paren-mode)
(require-package 'epl)
(require-package 'exec-path-from-shell)
;; Sort out the $PATH for OSX
(require 'exec-path-from-shell)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(dolist (file '("cfg-paredit.el"
"cfg-flycheck.el"
"cfg-hlsexp.el"
"cfg-cider.el"
"cfg-cljrefactor.el"))
(load (concat dotfiles-lisp-dir file)))
;; Custom User configurations:
;; If you wish to add additional functionality to your emacs config beyond what is in this setup,
;; simply add a file called "user-customizations.el" to your .emacs.d/lisp/ directory. Within that file,
;; you have access to the (require-package ...) function defined here, so for example, you could have:
;; (require-package 'rainbow-delimiters)
;; This would be all that is needed for emacs to automatically download the Rainbow Delimiters package
;; from Melpa. Additional configs of any kind could be added to this user-customizations.el file.
;; If the file is ommitted, no problem, no customizations are run.
(when (file-exists-p (concat dotfiles-lisp-dir "user-customizations.el"))
(load (concat dotfiles-lisp-dir "user-customizations.el")))