-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
72 lines (51 loc) · 2.17 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
;;; init.el --- Emacs initiliazation
;;; Commentary:
;;; Emacs initialization
;;; Code:
;; Set paths
(defvar custom-dir (expand-file-name "custom" user-emacs-directory))
(defvar site-lisp-dir (expand-file-name "site-lisp" user-emacs-directory))
(defvar theme-dir (expand-file-name "themes" user-emacs-directory))
(defvar tern-dir (expand-file-name "tern/emacs" user-emacs-directory))
;; Enable commands
(put 'scroll-left 'disabled nil)
;; Remove trailing whitespace
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Write backup files to own directory
(setq backup-directory-alist
`(("." . ,(expand-file-name
(concat user-emacs-directory "backups")))))
;; Make backups of files, even when they're in version control
(setq vc-make-backup-files t)
;; Add package manager configuration
(eval-and-compile
(package-initialize nil)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(unless (file-exists-p (expand-file-name "elpa/archives/gnu" user-emacs-directory))
(package-refresh-contents))
(unless (file-exists-p (expand-file-name "elpa/archives/marmalade" user-emacs-directory))
(package-refresh-contents))
(unless (file-exists-p (expand-file-name "elpa/archives/melpa" user-emacs-directory))
(package-refresh-contents))
(unless (file-exists-p (expand-file-name "elpa/archives/melpa-stable" user-emacs-directory))
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(defvar use-package-verbose t)
(require 'cl)
(require 'use-package))
;; theme
(load-file (expand-file-name "material-theme.el" theme-dir))
;; custom file
(setq custom-file (expand-file-name "preferences.el" user-emacs-directory))
(load custom-file)
;; Set up load path
(add-to-list 'load-path custom-dir)
(require 'custom-funcs)
(require 'custom-env)
(require 'custom-packages)
(require 'custom-key-bindings)
(require 'linum-off)