-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
325 lines (247 loc) · 11.4 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
;; ido-mode settings
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
(setq backup-directory-alist `(("." . "~/.emacs-backups")))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 10
kept-old-versions 10
version-control t)
;; turn on paren match highlighting
(show-paren-mode 1)
;; deleting files goes to OS's trash folder
(setq delete-by-moving-to-trash t)
;; y or n shortcut for confirmations
(fset 'yes-or-no-p 'y-or-n-p)
;; automatically reload files was modified by external program
(global-auto-revert-mode 1)
;; highlight current line
(global-hl-line-mode -1)
;; hide menu bar mode
(menu-bar-mode 1)
;; more readable :)
(when (display-graphic-p)
(tool-bar-mode -1)
(scroll-bar-mode -1))
;; use spaces instead of tabs
(setq-default indent-tabs-mode nil)
; will reduce the number of messages that appear in the “*Messages*” window to 512.
(setq message-log-max 512)
; add /usr/local/bin to path
(add-to-list 'exec-path "/usr/local/bin")
(setq-default show-trailing-whitespace t)
(setq inhibit-startup-message t) ; Don't want any startup message
(setq make-backup-files nil) ; Don't want any backup files
(setq auto-save-list-file-name nil) ; Don't want any .saves files
(setq auto-save-default nil) ; Don't want any auto saving
(setq search-highlight t) ; Highlight search object
(setq query-replace-highlight t) ; Highlight query object
(setq mouse-sel-retain-highlight t) ; Keep mouse high-lightening
(delete-selection-mode 1)
(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.
'(deft-auto-save-interval 5.0)
'(deft-directory "~/Documents/Emacs/deft/")
'(deft-extension "org")
'(deft-text-mode (quote org-mode))
'(gnus-directory "~/Documents/Emacs/News/")
'(gnus-home-directory "~/Documents/Emacs")
'(load-dir-recursive t)
'(org-agenda-files (quote ("~/Documents/Emacs/deft/todos.org")))
'(org-export-latex-listings t)
'(package-selected-packages (quote (exec-path-from-shell alchemist auto-complete)))
'(tabbar-separator (quote (1.0)))
'(tabbar-use-images t))
(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.
'(magit-item-highlight ((t (:inherit nil))))
'(tabbar-button ((t (:inherit tabbar-default :height 1.0))))
'(tabbar-button-highlight ((t (:inherit tabbar-default :height 1.0))))
'(tabbar-default ((t (:inherit variable-pitch :background "highlightColor" :foreground "secondaryLabelColor" :height 1.0))))
'(tabbar-modified ((t (:inherit tabbar-default :foreground "green" :box (:line-width 1 :color "white" :style released-button) :height 1.0))))
'(tabbar-selected ((t (:inherit tabbar-default :foreground "Purple" :box (:line-width 1 :color "white" :style pressed-button) :height 1.0))))
'(tabbar-unselected ((t (:inherit tabbar-default :height 1.0)))))
;; (desktop-save-mode 1)
;; (require 'package)
;; (add-to-list 'package-archives
;; '("melpa" . "http://melpa.milkbox.net/packages/") t)
;; (package-initialize)
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/dict")
;; (require 'auto-complete-config)
;; (add-to-list 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete-1.4/dict")
;; (ac-config-default)
;; ; Use dictionaries by default
;; (setq-default ac-sources (add-to-list 'ac-sources 'ac-source-dictionary))
;; (global-auto-complete-mode t)
;; ; Start auto-completion after 2 characters of a word
;; (setq ac-auto-start 2)
;; ; case sensitivity is important when finding matches
;; (setq ac-ignore-case nil)
(add-to-list 'load-path "~/.emacs.d/packages/deft")
(require 'deft)
(add-to-list 'load-path "~/.emacs.d/packages/git-modes")
(add-to-list 'load-path "~/.emacs.d/packages/magit")
(require 'magit)
(add-to-list 'load-path "~/.emacs.d/packages/htmlize")
(require 'htmlize)
(add-to-list 'load-path "~/.emacs.d/packages/swift-mode")
(require 'swift-mode)
(add-to-list 'load-path "~/.emacs.d/packages/git-timemachine")
(require 'git-timemachine)
(add-to-list 'load-path "~/.emacs.d/packages/popwin-el")
(require 'popwin)
(popwin-mode 1)
(add-to-list 'load-path "~/.emacs.d/packages/emacs-elixir/")
(require 'elixir-mode)
;; (autoload 'markdown-mode "markdown-mode"
;; "Major mode for editing Markdown files" t)
(add-to-list 'load-path "~/.emacs.d/packages/markdown-mode")
(require 'markdown-mode)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-to-list 'load-path "~/.emacs.d/packages/web-mode/")
(require 'web-mode)
(add-to-list 'load-path "~/.emacs.d/packages/yaml-mode/")
(require 'yaml-mode)
(add-to-list 'load-path "~/.emacs.d/packages/yasnippet")
(require 'yasnippet)
(add-to-list 'load-path "~/.emacs.d/packages/avy")
(require 'avy)
(add-to-list 'load-path "~/.emacs.d/packages/ace-window")
(require 'ace-window)
(add-to-list 'load-path "~/.emacs.d/packages/inf-ruby")
(autoload 'inf-ruby-minor-mode "inf-ruby" "Run an inferior Ruby process" t)
(add-hook 'ruby-mode-hook 'inf-ruby-minor-mode)
(load-file "~/.emacs.d/personal/key_bindings.el")
(load-file "~/.emacs.d/personal/detect_mode.el")
(load-file "~/.emacs.d/personal/custom_functions.el")
(load-file "~/.emacs.d/personal/hooks/ruby.el")
(load-file "~/.emacs.d/personal/hooks/javascript.el")
(load-file "~/.emacs.d/personal/hooks/yaml.el")
(load-file "~/.emacs.d/personal/hooks/yas.el")
(autoload 'zap-up-to-char "misc"
"Kill up to, but not including ARGth occurrence of CHAR." t)
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
;; (global-set-key (kbd "M-/") 'hippie-expand)
(setq require-final-newline t
visible-bell t
ediff-window-setup-function 'ediff-setup-windows-plain)
(add-to-list 'load-path "~/.emacs.d/packages/neotree")
(require 'neotree)
(add-to-list 'load-path "~/.emacs.d/packages/tabbar-mode")
(require 'tabbar)
(tabbar-mode)
(add-to-list 'load-path "~/.emacs.d/packages/yari")
(require 'yari)
(define-key 'help-command "R" 'yari)
;; Display ido results vertically, rather than horizontally
(setq ido-decorations (quote ("\n-> " "" "\n " "\n ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(defun ido-disable-line-truncation () (set (make-local-variable 'truncate-lines) nil))
(add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-truncation)
(defun ido-define-keys () ;; C-n/p is more intuitive in vertical layout
(define-key ido-completion-map (kbd "C-n") 'ido-next-match)
(define-key ido-completion-map (kbd "C-p") 'ido-prev-match))
(add-hook 'ido-setup-hook 'ido-define-keys)
(defun tabbar-buffer-groups-by-dir ()
"Put all files in the same directory into the same tab bar"
(with-current-buffer (current-buffer)
(let ((dir (expand-file-name default-directory)))
(cond ;; assign group name until one clause succeeds, so the order is important
((eq major-mode 'dired-mode)
(list "Dired"))
((memq major-mode
'(help-mode apropos-mode Info-mode Man-mode))
(list "Help"))
((string-match-p "\*.*\*" (buffer-name))
(list "Misc"))
(t (list dir))))))
(defun tabbar-switch-grouping-method (&optional arg)
"Changes grouping method of tabbar to grouping by dir.
With a prefix arg, changes to grouping by major mode."
(interactive "P")
(ignore-errors
(if arg
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups) ;; the default setting
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups-by-dir))))
(setq ido-ignore-directories
'("Applications/" "Documents/" "Library/" "Movies/" "Music/" "Pictures/" "Public/"))
(add-to-list 'load-path "~/.emacs.d/packages/textile-mode")
(require 'textile-mode)
(add-to-list 'auto-mode-alist '("\\.textile\\'" . textile-mode))
(add-to-list 'load-path "~/.emacs.d/packages/org-textile/")
(require 'ox-textile)
(add-to-list 'load-path "~/emacs.d/packages/flx")
(load-file "~/.emacs.d/packages/flx/flx.el")
(load-file "~/.emacs.d/packages/flx/flx-ido.el")
(require 'flx)
(require 'flx-ido)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil)
(add-to-list 'load-path "~/.emacs.d/packages/dash")
(require 'dash)
(add-to-list 'load-path "~/.emacs.d/packages/projectile-mode")
(load-file "~/.emacs.d/packages/projectile-mode/projectile.el")
(defun is-in-terminal()
(not (display-graphic-p)))
(add-to-list 'load-path "~/.emacs.d/packages/evil")
(require 'evil)
(add-to-list 'load-path "~/.emacs.d/packages/powerline")
(require 'powerline)
(powerline-center-evil-theme)
;; ;
(powerline-evil-theme)
(add-to-list 'load-path "~/.emacs.d/packages/elixir")
(require 'elixir-mode)
(load-file "~/.emacs.d/packages/gnuplot-mode/gnuplot.el")
;; active Babel languages
(org-babel-do-load-languages
'org-babel-load-languages
'((gnuplot . t)))
;; add additional languages with '((language . t)))
(font-lock-add-keywords 'org-mode
'(("^ +\\([-*]\\) "
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
(add-to-list 'load-path "~/.emacs.d/packages/org-bullets")
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(let* ((variable-tuple (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
((x-list-fonts "Verdana") '(:font "Verdana"))
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
(base-font-color (face-foreground 'default nil 'default))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
(custom-theme-set-faces 'user
`(org-level-8 ((t (,@headline ,@variable-tuple))))
`(org-level-7 ((t (,@headline ,@variable-tuple))))
`(org-level-6 ((t (,@headline ,@variable-tuple))))
`(org-level-5 ((t (,@headline ,@variable-tuple))))
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5))))
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75))))
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil))))))
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(setq alchemist-execute-command "/usr/local/bin/elixir") ;; default: elixir
(setq alchemist-compile-command "/usr/local/bin/elixirc") ;; default: elixirc
(setq alchemist-iex-program-name "/usr/local/bin/iex") ;; default: iex