-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
83 lines (70 loc) · 2.76 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
(require 'package)
(package-initialize)
(setq gc-cons-threshold 100000000)
(defun load-directory (dir)
(let ((load-it
(lambda (f)
(load-file (concat (file-name-as-directory dir) f)))))
(mapc load-it (directory-files dir nil "\\.el$"))))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives `("melpa" . "http://melpa.org/packages/"))
(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)
(if (boundp 'package-selected-packages)
;; Record this as a package the user installed explicitly
(package-install package nil)
(package-install package))
(progn
(package-refresh-contents)
(require-package package min-version t)))))
(defun maybe-require-package (package &optional min-version no-refresh)
"Try to install PACKAGE, and return non-nil if successful.
In the event of failure, return nil and print a warning message.
Optionally require MIN-VERSION. If NO-REFRESH is non-nil, the
available package lists will not be re-downloaded in order to
locate PACKAGE."
(condition-case err
(require-package package min-version no-refresh)
(error
(message "Couldn't install package `%s': %S" package err)
nil)))
(defun from-emacsd
(str)
"from .emacs.d"
(convert-standard-filename
(expand-file-name
(concat "~/.emacs.d/" str))))
(defun to-file
(str)
"standardisation of the filename"
(convert-standard-filename
(expand-file-name str)))
(add-to-list 'load-path
(from-emacsd "vendor/"))
(require 'use-package)
(use-package diminish :ensure)
;;; Fire up package.el
(setq package-enable-at-startup nil)
(load-file (from-emacsd "init/preferences.el"))
(load-file (from-emacsd "init/misc.el"))
(load-file (from-emacsd "init/themes.el"))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(initial-frame-alist (quote ((fullscreen . maximized))))
'(package-selected-packages
(quote
(darktooth-theme yasnippet company powerline multiple-cursors flycheck counsel-projectile ag counsel smex diminish))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)