-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
98 lines (81 loc) · 2.66 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
;; Package configs
(require 'package)
(setq package-enable-at-startup nil)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; (package-refresh-contents)
(unless (file-exists-p "~/.emacs.d/elpa/archives/melpa")
(package-refresh-contents))
;; add configs directory to load path
(setq configs-path
(expand-file-name "configs" user-emacs-directory))
(add-to-list 'load-path configs-path)
(setq themes-path
(expand-file-name "themes" user-emacs-directory))
(add-to-list 'load-path themes-path)
(add-to-list 'custom-theme-load-path themes-path)
;; load custom.el
(setq custom-file
(expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
;; Bootstrap 'use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
;; install and require packages config
(setq config-files
'(packages-config
evil-config
ace-jump-config
helm-config
neotree-config
ui-config
all-the-icons-config
functions
markdown-config
projectile-config
webmode-config
rainbow-config
rust-mode-config
magit-config
go-mode-config
org-config
yafolding-config
yaml-config
restclient-config
perspective-config
protobuf-mode
idle-org-agenda))
(dolist (config-file config-files)
(require config-file))
;; call functions config
(change-mode-line-color)
(disable-backup-files)
(run-theme-timer)
;; Other setup
;; Indentation
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(define-key evil-insert-state-map (kbd "TAB") 'tab-to-tab-stop)
;; Cua mode
;; C-c, C-x, C-v to copy, cut and paste
(cua-mode 1)
;; Disable auto insert utf-8 in ruby-mode
(setq ruby-insert-encoding-magic-comment nil)
;; Auto revert mode
(global-auto-revert-mode 1)
;; Show matching parenthesis
(setq show-paren-delay 0)
(show-paren-mode 1)
;; increase GC threshold
(setq gc-cons-threshold 80000000)