-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
259 lines (210 loc) · 7.37 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
;;; init.el --- The initial emacs load script
;;; Commentary:
;; Copyright 2014 Remy Goldschmidt
;; Provided under the GNU General Public License v3.0
;;; Code:
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(with-current-buffer
(url-retrieve-synchronously
"https://github.com/dimitri/el-get/raw/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
;; now either el-get is `require'd already, or have been `load'ed by the
;; el-get installer.
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
(require 'el-get)
;; now set our own packages
(defvar my-packages
'(el-get
cedet
org-mode
color-theme-solarized
escreen
helm
rainbow-delimiters
smartparens
yasnippet
yaml-mode
markdown-mode
let-alist
ace-jump-mode
flycheck
flycheck-haskell
;; haskell-flycheck
flyspell
magit
projectile
diminish
tramp
powerline
company-mode
company-ghc
hi2
haskell-mode
ghc-mod
iedit
smex
k3-mode
ledger-mode
multi-term
purescript-mode
scala-mode
flycheck-pmd
undo-tree
multiple-cursors
evil))
;; install new packages and init already installed packages
(el-get 'sync my-packages)
;; remove all packages not listed
(el-get-cleanup my-packages)
(require 'undo-tree)
(global-undo-tree-mode)
(require 'cedet-remove-builtin)
;;(require 'k3-mode)
;;(require 'haskell-flycheck)
;; (require 'cedet-devel-load)
;; (require 'ede/generic)
;; (require 'ede/java-root)
;; (require 'ede/jvm-base)
;; (require 'ede/maven2)
;; (require 'semantic/ia)
;; (require 'semantic/db-javap)
;; (semantic-mode 1)
;; (global-ede-mode t)
(require 'multiple-cursors)
(require 'evil)
(evil-mode 1)
;; on to the visual settings
(setq inhibit-splash-screen t) ; no splash screen, thanks
(line-number-mode 1) ; have line numbers and
(column-number-mode 1) ; column numbers in the mode line
(tool-bar-mode -1) ; no tool bar with icons
(scroll-bar-mode -1) ; no scroll bars
(menu-bar-mode -1)
;; Uncomment this line if you don't have/want Inconsolata
(setq default-frame-alist '((font . "Inconsolata-10")))
(global-hl-line-mode) ; highlight current line
(global-linum-mode 1) ; add line numbers on the left
(defvar linum-format)
(setq linum-format "%4d \u2502")
(defvar linum-disable)
(setq linum-disable (lambda () (linum-mode -1)))
(add-hook 'term-mode-hook linum-disable)
(add-hook 'multi-term-mode-hook linum-disable)
(add-hook 'haskell-interactive-mode-hook linum-disable)
(add-hook 'java-mode-hook
(lambda () (interactive) (flycheck-select-checker 'java-pmd)))
(setq exec-path (append exec-path '("~/.emacs.d/bin")))
;; Comment to unbind meta arrows to change panes
(windmove-default-keybindings 'meta)
(defvar windmove-wrap-around)
(setq windmove-wrap-around t)
(setq x-select-enable-clipboard t)
(require 'term)
(require 'rainbow-delimiters)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(require 'smartparens-config)
(setq-default indent-tabs-mode nil)
;(setq-default cursor-type 'bar)
(setq backup-directory-alist `(("." . ,(expand-file-name "~/.emacs.d/backups"))))
;; Save all tempfiles in $TMPDIR/emacs$UID/
(defconst emacs-tmp-dir (format "%s/%s%s/" temporary-file-directory "emacs" (user-uid)))
(setq auto-save-file-name-transforms
`((".*" ,emacs-tmp-dir t)))
(setq auto-save-list-file-prefix
emacs-tmp-dir)
(require 'powerline)
(powerline-default-theme)
(global-set-key (kbd "C-x C-k") 'kill-buffer)
(global-set-key (kbd "C-x f") 'find-file)
(global-set-key [f5] 'compile)
(global-set-key [f6] 'recompile)
(setq-default compilation-scroll-output t)
(electric-indent-mode +1)
(setq-default flycheck-emacs-lisp-load-path 'inherit)
(turn-on-haskell-simple-indent)
(global-company-mode)
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
(require 'smartparens-config)
(smartparens-global-mode)
;;(defadvice haskell-mode-stylish-buffer (around skip-if-flycheck-errors activate)
;; "Add haskell-stylish to haskell-mode."
;; (unless (flycheck-has-current-errors-p 'error)
;; ad-do-it))
(add-hook 'haskell-mode-hook 'turn-on-hi2)
(global-flycheck-mode)
(eval-after-load 'flycheck
'(add-hook 'flycheck-mode-hook #'flycheck-haskell-setup))
(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.
'(create-lockfiles nil)
'(display-buffer-alist (quote (("" ignore (reusable-frames . t) (nil)))))
'(ede-project-directories (quote ("/home/remy/Documents/ResearchWork/KHaskell/k")))
'(flycheck-pmd-rulesets
(quote
("java-basic" "java-design" "java-imports" "java-braces" "java-optimizations")))
'(frame-background-mode (quote dark))
'(haskell-complete-module-preferred
(quote
("Data.ByteString" "Data.ByteString.Lazy" "Data.Conduit" "Data.Function" "Data.List" "Data.Map" "Data.Maybe" "Data.Monoid" "Data.Ord")))
'(haskell-interactive-mode-eval-mode (quote ignore))
'(haskell-interactive-mode-eval-pretty nil)
'(haskell-interactive-mode-include-file-name nil)
'(haskell-interactive-mode-scroll-to-bottom t)
'(haskell-mode-hook
(quote
(interactive-haskell-mode turn-on-haskell-indentation turn-on-haskell-doc-mode)) t)
'(haskell-notify-p t)
'(haskell-process-auto-import-loaded-modules t)
'(haskell-process-generate-tags nil)
'(haskell-process-reload-with-fbytecode nil)
'(haskell-process-suggest-haskell-docs-imports nil)
'(haskell-process-suggest-hoogle-imports t)
'(haskell-process-suggest-overloaded-strings t)
'(haskell-process-suggest-remove-import-lines t)
'(haskell-process-type (quote cabal-repl))
'(haskell-process-use-presentation-mode t)
'(haskell-stylish-on-save t)
'(hi2-show-indentations nil)
'(hs-lint-executable "hlint --ignore='Use camelCase'"))
(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(require 'haskell-interactive-mode)
(define-key haskell-interactive-mode-map (kbd "C-c C-t") 'haskell-mode-show-type-at)
(global-set-key (kbd "C-x a r") 'align-regexp)
(global-set-key (kbd "M-[") 'align)
(require 'ace-jump-mode)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(provide 'init)
(defun revert-all-buffers ()
"Refreshes all open buffers from their restpective files."
(interactive)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (and (buffer-file-name)
(file-exists-p (buffer-file-name))
(not (buffer-modified-p)) )
(revert-buffer t t t) )))
(message "Refreshed open files.") )
;;(server-start) ;; uncomment if emacs.service is not present
;;; init.el ends here
(put 'upcase-region 'disabled nil)
(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.
)
(load-theme 'solarized t)
(setq c-default-style "linux")
(setq-default c-basic-offset 4
tab-width 4)
(setq multi-term-program-switches "--login")
(setq cua-enable-cua-keys nil)
(setq cua-delete-selection nil)