-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
269 lines (198 loc) · 6.43 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
;; init.el
;; ------------------------------
;; Author: Mads Obitsø
;; contains lot's of copied code
;; Turn off mouse interface early in startup to avoid momentary display
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;; Send the splash screen crying back to it's mother
(setq inhibit-startup-message t)
;; Ask before killing emacs
(setq confirm-kill-emacs 'y-or-n-p)
;; Waste of bytes
(setq initial-scratch-message
";; Welcome to your domain of evil
;; The elisp is loose
")
;; Straight to *scratch*
(setq initial-buffer-choice t)
;; Set path to dependencies
(setq site-lisp-dir
(expand-file-name "site-lisp" user-emacs-directory))
(setq my-setup-lisp
(expand-file-name "my-setup" user-emacs-directory))
;; Set up load
(add-to-list 'load-path my-setup-lisp)
(add-to-list 'load-path site-lisp-dir)
;; Make site-lisp-dir the package folder
(setq package-user-dir "~/.emacs.d/site-lisp")
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;(package-initialize)
;; Setup packages
(require 'setup-package)
;; Are we on a mac?
(setq is-mac (equal system-type 'darwin))
;; Install extensions if they're missing
(defun init--install-packages ()
(packages-install
'(undo-tree
ace-jump-mode
smex
highlight-escape-sequences
;; shell-command
flx-ido
ido-vertical-mode
ido-at-point
ido-completing-read+
expand-region
multiple-cursors
auto-complete
yasnippet
markdown-mode
;; helm
auctex
fsharp-mode
smart-mode-line
rainbow-delimiters
highlight-numbers
highlight-indent-guides
column-enforce-mode
)))
(condition-case nil
(init--install-packages)
(error
(package-refresh-contents)
(init--install-packages)))
;; Keep emacs Custom-settings in separate file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
;; Setup appearance early
(require 'appearance)
;; Add external projects to load path
;;(dolist (project (directory-files site-lisp-dir t "\\w+"))
;; (when (file-directory-p project)
;; (add-to-list 'load-path project)))
;; Setup smooth scrolling
(require 'mouse)
;; Setup my custom functions
(require 'my-functions)
;; setup custom keybindings
(require 'keybindings)
;; Write backup files to own directory
;; Get's rid of ~file~
(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)
;; Set up saveplace
(require 'saveplace)
(setq-default save-place t)
(setq save-place-file (expand-file-name ".places" user-emacs-directory))
;; Start with sane defaults
(require 'sane-defaults)
;; If so, set some stuff
(when is-mac
(require-package 'exec-path-from-shell)
(exec-path-from-shell-initialize)
(require 'mac))
;; Setup extensions
;; (eval-after-load 'shell '(require 'setup-shell))
;; Font lock dash.el
(eval-after-load 'dash '(dash-enable-font-lock))
;; Setup yasnippet
(require 'setup-yasnippet)
;; Setup ido
(require 'setup-ido)
;; Map files to modes
(require 'mode-mappings)
;; Setup smex - Smart M-x
(require 'smex)
(smex-initialize)
;; Set up autocomplete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/auto-complete-20140803.2118/dict")
(ac-config-default)
(global-auto-complete-mode t)
;; Set up org
(require 'org)
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(setq org-directory "~/Dropbox/org")
(setq org-agenda-files (list "~/Dropbox/org/personal/main.org" ;; Main tasks
"~/Dropbox/org/personal/longtermcal.org" ;; Long time
"~/Dropbox/org/personal/school.org" ;; School tasks
"~/Dropbox/org/personal/longtermschool.org" ;; Long school
; "~/.emacs.d/orgModeTests/calendarFromKU.org" ;; Cal from Instructure Canvas
"~/Dropbox/org/personal/birthdays.org"
; "~/org/flagged.org"
"~/Dropbox/org/personal/instruktor.org"
"~/Dropbox/org/personal/pcs_instruktor.org"))
(setq org-todo-keywords
'((sequence "TODO" "IN-PROGRESS" "|" "DONE" "CANCELLED")))
;; Mobile org
;; (setq org-mobile-inbox-for-pull "~/org/flagged.org")
;; (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg")
;; setup some variables for WDIRED
;; invoke with C-x C-q in any dired buffer
;; edit stuff, commit with C-c C-C
(setq wdired-use-interactive-rename t)
(setq wdired-confirm-overwrite t)
;; Setup latex
(require 'setup-latex)
;; Setup fsharp
(require 'setup-fsharp)
;; Setup python-mode
;; ------------------------------
;;
;;
;; (require 'python-mode)
;; ;; use IPython
;; (setq-default py-shell-name "ipython")
;; (setq-default py-which-bufname "IPython")
;; ; use the wx backend, for both mayavi and matplotlib
;; (setq py-python-command-args
;; '("--gui=wx" "--pylab=wx" "-colors" "Linux"))
;; (setq py-force-py-shell-name-p t)
;; ; switch to the interpreter after executing code
;; (setq py-shell-switch-buffers-on-execute-p t)
;; (setq py-switch-buffers-on-execute-p t)
;; ; don't split windows
;; (setq py-split-windows-on-execute-p t)
;; ; try to automagically figure out indentation
;; (setq py-smart-indentation t)
;; Setup el-py mode
;; ------------------------------
;; Sets up elpy
;; (require 'setup-elpy)
;; Setup htmlize
;; ------------------------------
;; Creates an html version with css of the current buffer
;; keeps formatting, syntax-highlighting etc.
;; (require 'htmlize)
;; Setup Markdown major mode
;; ------------------------------
;; Major mode for editing markdown files
;;
(require 'markdown-mode)
;; Undo-tree
;; ------------------------------
(require 'undo-tree)
(global-undo-tree-mode)
;; Setup helm-spotify-custom
;;(require 'helm-spotify-custom)
(require 'highlight-escape-sequences)
(hes-mode)
(put 'font-lock-regexp-grouping-backslash 'face-alias 'font-lock-builtin-face)
(require 'expand-region)
(require 'multiple-cursors)
;(require 'latex-wc-mode)
(require 'lwc-mode)
;; Enable upcase and downcase region (C-x C-u & C-x C-l)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)