commit | author | age
|
5cb5f7
|
1 |
(provide 'init) |
C |
2 |
|
|
3 |
;; set paths for executable |
9c4cf0
|
4 |
;; use mingw64 for aspell, poppler (pdf-tools), gcc, ghostscript |
5cb5f7
|
5 |
(add-to-list 'exec-path "C:/msys64/usr/bin") |
C |
6 |
(add-to-list 'exec-path "C:/msys64/mingw64/bin") |
707431
|
7 |
(add-to-list 'exec-path "c:/Program Files/Racket") |
5cb5f7
|
8 |
(setenv "PATH" (mapconcat #'identity exec-path path-separator)) |
C |
9 |
|
|
10 |
;; adding modules to load path |
|
11 |
(add-to-list 'load-path "~/.emacs.d/custom/") |
707431
|
12 |
(add-to-list 'load-path "~/.emacs.d/elpa/") |
5cb5f7
|
13 |
|
C |
14 |
;; load your modules |
|
15 |
(require 'setup-applications) |
|
16 |
(require 'setup-communication) |
|
17 |
(require 'setup-convenience) |
|
18 |
(require 'setup-data) |
|
19 |
(require 'setup-development) |
|
20 |
(require 'setup-editing) |
|
21 |
(require 'setup-environment) |
|
22 |
(require 'setup-external) |
|
23 |
(require 'setup-faces) |
|
24 |
(require 'setup-files) |
|
25 |
(require 'setup-help) |
|
26 |
(require 'setup-programming) |
|
27 |
(require 'setup-text) |
|
28 |
(require 'setup-local) |
|
29 |
|
|
30 |
;; setting up aspell |
|
31 |
(require 'ispell) |
|
32 |
(setq-default ispell-program-name "aspell") |
9c4cf0
|
33 |
(add-hook 'latex-mode-hook 'flyspell-mode) |
C |
34 |
(add-hook 'latex-mode-hook 'flyspell-buffer) |
|
35 |
(add-hook 'org-mode-hook 'flyspell-mode) |
|
36 |
(add-hook 'org-mode-hook 'flyspell-buffer) |
5cb5f7
|
37 |
|
a4b917
|
38 |
;; Repos |
5cb5f7
|
39 |
(require 'package) |
a4b917
|
40 |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) |
e75a20
|
41 |
;; (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) |
a4b917
|
42 |
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")) |
C |
43 |
|
|
44 |
;; use-package |
5cb5f7
|
45 |
(package-initialize) |
a4b917
|
46 |
(unless (package-installed-p 'use-package) |
C |
47 |
(package-refresh-contents) |
|
48 |
(package-install 'use-package)) |
|
49 |
|
|
50 |
(eval-when-compile |
|
51 |
(require 'use-package)) |
|
52 |
|
5cb5f7
|
53 |
|
707431
|
54 |
;; auto-package-update |
C |
55 |
(use-package auto-package-update |
9c4cf0
|
56 |
:ensure t |
707431
|
57 |
:config |
e75a20
|
58 |
(setq auto-package-update-delete-old-versions t) |
C |
59 |
(setq auto-package-update-hide-results t) |
|
60 |
(auto-package-update-maybe)) |
|
61 |
|
|
62 |
;; zenburn theme |
|
63 |
(use-package zenburn-theme |
|
64 |
:ensure t |
|
65 |
:config |
e7fb24
|
66 |
(load-theme 'zenburn t) |
707431
|
67 |
(setq auto-package-update-delete-old-versions t) |
C |
68 |
(setq auto-package-update-hide-results t) |
|
69 |
(auto-package-update-maybe)) |
|
70 |
|
5cb5f7
|
71 |
;; helm |
707431
|
72 |
(use-package helm-config |
C |
73 |
:ensure helm |
|
74 |
:bind (("M-x" . helm-M-x) |
|
75 |
("C-x C-f" . helm-find-files) |
|
76 |
("M-y" . helm-show-kill-ring) |
|
77 |
("C-x b" . helm-mini) |
|
78 |
("C-c h o" . helm-occur)) |
|
79 |
:config |
|
80 |
(setq helm-M-x-fuzzy-match t) |
|
81 |
(setq helm-buffers-fuzzy-matching t |
|
82 |
helm-recentf-fuzzy-match t) |
|
83 |
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window |
|
84 |
helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source. |
|
85 |
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp. |
|
86 |
helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior> |
|
87 |
helm-ff-file-name-history-use-recentf t |
|
88 |
helm-echo-input-in-header-line t) |
|
89 |
(defun spacemacs//helm-hide-minibuffer-maybe () |
|
90 |
"Hide minibuffer in Helm session if we use the header line as input field." |
|
91 |
(when (with-helm-buffer helm-echo-input-in-header-line) |
|
92 |
(let ((ov (make-overlay (point-min) (point-max) nil nil t))) |
|
93 |
(overlay-put ov 'window (selected-window)) |
|
94 |
(overlay-put ov 'face |
|
95 |
(let ((bg-color (face-background 'default nil))) |
|
96 |
`(:background ,bg-color :foreground ,bg-color))) |
|
97 |
(setq-local cursor-type nil)))) |
|
98 |
(add-hook 'helm-minibuffer-set-up-hook |
|
99 |
'spacemacs//helm-hide-minibuffer-maybe) |
|
100 |
(helm-mode 1) |
|
101 |
(setq auto-package-update-delete-old-versions t) |
|
102 |
(setq auto-package-update-hide-results t) |
|
103 |
(auto-package-update-maybe)) |
5cb5f7
|
104 |
|
9d27fc
|
105 |
;; undo-tree |
707431
|
106 |
(use-package undo-tree |
C |
107 |
:ensure t |
|
108 |
:config |
|
109 |
(global-undo-tree-mode) |
|
110 |
(setq auto-package-update-delete-old-versions t) |
|
111 |
(setq auto-package-update-hide-results t) |
|
112 |
(auto-package-update-maybe)) |
5cb5f7
|
113 |
|
9d27fc
|
114 |
;; volatile highlights |
707431
|
115 |
(use-package volatile-highlights |
C |
116 |
:ensure t |
|
117 |
:config |
|
118 |
(volatile-highlights-mode t) |
|
119 |
(setq auto-package-update-delete-old-versions t) |
|
120 |
(setq auto-package-update-hide-results t) |
|
121 |
(auto-package-update-maybe)) |
5cb5f7
|
122 |
|
9d27fc
|
123 |
;; yasnippet |
707431
|
124 |
(use-package yasnippet |
C |
125 |
:ensure t |
|
126 |
:config |
|
127 |
(yas-global-mode 1) |
|
128 |
(setq auto-package-update-delete-old-versions t) |
|
129 |
(setq auto-package-update-hide-results t) |
|
130 |
(auto-package-update-maybe)) |
5cb5f7
|
131 |
|
9d27fc
|
132 |
;; ggtags |
707431
|
133 |
(use-package ggtags |
C |
134 |
:ensure t |
|
135 |
:config |
|
136 |
(add-hook 'c-mode-common-hook |
|
137 |
(lambda |
|
138 |
(when (derived-mode-p 'c-mode 'c++-mode 'java-mode) |
|
139 |
(ggtags-mode 1)))) |
|
140 |
(setq auto-package-update-delete-old-versions t) |
|
141 |
(setq auto-package-update-hide-results t) |
|
142 |
(auto-package-update-maybe)) |
5cb5f7
|
143 |
|
9d27fc
|
144 |
;; workgroups2 |
707431
|
145 |
(use-package workgroups |
C |
146 |
:ensure t |
|
147 |
:config |
|
148 |
(workgroups-mode 1) |
|
149 |
(setq auto-package-update-delete-old-versions t) |
|
150 |
(setq auto-package-update-hide-results t) |
|
151 |
(auto-package-update-maybe)) |
5cb5f7
|
152 |
|
9d27fc
|
153 |
;; smartparens |
707431
|
154 |
(use-package smartparens |
C |
155 |
:ensure t |
|
156 |
:diminish smartparens-mode |
|
157 |
:config |
|
158 |
(progn |
|
159 |
(require 'smartparens-config) |
|
160 |
(smartparens-global-mode 1)) |
|
161 |
(setq auto-package-update-delete-old-versions t) |
|
162 |
(setq auto-package-update-hide-results t) |
|
163 |
(auto-package-update-maybe)) |
5cb5f7
|
164 |
|
C |
165 |
;; clean-aindent-mode |
707431
|
166 |
(use-package clean-aindent-mode |
C |
167 |
:ensure t |
|
168 |
:hook prog-mode |
|
169 |
:config |
|
170 |
(setq auto-package-update-delete-old-versions t) |
|
171 |
(setq auto-package-update-hide-results t) |
|
172 |
(auto-package-update-maybe)) |
5cb5f7
|
173 |
|
C |
174 |
;; company config |
707431
|
175 |
(use-package company |
C |
176 |
:ensure t |
|
177 |
:init (global-company-mode) |
|
178 |
:config |
|
179 |
(add-hook 'c-mode-common-hook |
|
180 |
(lambda () |
|
181 |
(define-key c-mode-base-map [(tab)] 'company-complete))) |
178ab9
|
182 |
(setq auto-package-update-delete-old-versions t) |
C |
183 |
(setq auto-package-update-hide-results t) |
|
184 |
(auto-package-update-maybe)) |
|
185 |
|
|
186 |
(use-package company-c-headers |
|
187 |
:ensure t |
9c4cf0
|
188 |
:after company |
178ab9
|
189 |
:config |
C |
190 |
(add-to-list 'company-backends 'company-c-headers) |
9c4cf0
|
191 |
(setq auto-package-update-delete-old-versions t) |
C |
192 |
(setq auto-package-update-hide-results t) |
|
193 |
(auto-package-update-maybe)) |
|
194 |
|
|
195 |
(use-package company-math |
|
196 |
:ensure t |
|
197 |
:after company |
|
198 |
:config |
|
199 |
(add-to-list 'company-backends 'company-math-symbols-unicode) |
707431
|
200 |
(setq auto-package-update-delete-old-versions t) |
C |
201 |
(setq auto-package-update-hide-results t) |
|
202 |
(auto-package-update-maybe)) |
5cb5f7
|
203 |
|
C |
204 |
;; projectile config |
707431
|
205 |
(use-package projectile |
C |
206 |
:ensure t |
|
207 |
:bind (("C-c p" . projectile-command-map)) |
|
208 |
:config |
|
209 |
(projectile-global-mode) |
|
210 |
(setq projectile-completion-system 'helm) |
|
211 |
(setq projectile-indexing-method 'alien) |
|
212 |
(setq auto-package-update-delete-old-versions t) |
|
213 |
(setq auto-package-update-hide-results t) |
|
214 |
(auto-package-update-maybe)) |
5cb5f7
|
215 |
|
707431
|
216 |
(use-package helm-projectile |
C |
217 |
:ensure t |
|
218 |
:config |
|
219 |
(helm-projectile-on) |
|
220 |
(setq auto-package-update-delete-old-versions t) |
|
221 |
(setq auto-package-update-hide-results t) |
|
222 |
(auto-package-update-maybe)) |
5cb5f7
|
223 |
|
C |
224 |
;; magit config |
707431
|
225 |
(use-package magit |
C |
226 |
:commands magit-get-top-dir |
|
227 |
:bind (("C-x g s" . magit-status) |
|
228 |
("C-x g f" . magit-file-log) |
|
229 |
("C-x g h" . magit-log) |
|
230 |
("C-x g c" . magit-branch) |
|
231 |
("C-x g t" . magit-tag)) |
|
232 |
:init |
|
233 |
(progn |
|
234 |
;; make magit status go full-screen but remember previous window |
|
235 |
;; settings |
|
236 |
;; from: http://whattheemacsd.com/setup-magit.el-01.html |
|
237 |
(defadvice magit-status (around magit-fullscreen activate) |
|
238 |
(window-configuration-to-register :magit-fullscreen) |
|
239 |
ad-do-it |
|
240 |
(delete-other-windows)) |
|
241 |
|
|
242 |
;; Close popup when commiting - this stops the commit window |
|
243 |
;; hanging around |
|
244 |
;; From: http://git.io/rPBE0Q |
|
245 |
(defadvice git-commit-commit (after delete-window activate) |
|
246 |
(delete-window)) |
|
247 |
|
|
248 |
(defadvice git-commit-abort (after delete-window activate) |
|
249 |
(delete-window)) |
|
250 |
|
|
251 |
;; these two force a new line to be inserted into a commit window, |
|
252 |
;; which stops the invalid style showing up. |
|
253 |
;; From: http://git.io/rPBE0Q |
|
254 |
(defun magit-commit-mode-init () |
|
255 |
(when (looking-at "\n") |
|
256 |
(open-line 1))) |
|
257 |
|
|
258 |
(add-hook 'git-commit-mode-hook 'magit-commit-mode-init)) |
|
259 |
:config |
|
260 |
(progn |
|
261 |
;; restore previously hidden windows |
|
262 |
(defadvice magit-quit-window (around magit-restore-screen activate) |
|
263 |
(let ((current-mode major-mode)) |
|
264 |
ad-do-it |
|
265 |
;; we only want to jump to register when the last seen buffer |
|
266 |
;; was a magit-status buffer. |
|
267 |
(when (eq 'magit-status-mode current-mode) |
|
268 |
(jump-to-register :magit-fullscreen)))) |
|
269 |
|
|
270 |
(defun magit-maybe-commit (&optional show-options) |
|
271 |
"Runs magit-commit unless prefix is passed" |
|
272 |
(interactive "P") |
|
273 |
(if show-options |
|
274 |
(magit-key-mode-popup-committing) |
|
275 |
(magit-commit))) |
|
276 |
|
|
277 |
(define-key magit-mode-map "c" 'magit-maybe-commit) |
|
278 |
|
|
279 |
;; major mode for editing `git rebase -i` files |
|
280 |
(use-package rebase-mode) |
|
281 |
|
|
282 |
;; magit settings |
|
283 |
(setq |
|
284 |
;; use ido to look for branches |
|
285 |
magit-completing-read-function 'magit-ido-completing-read |
|
286 |
;; don't put "origin-" in front of new branch names by default |
|
287 |
magit-default-tracking-name-function 'magit-default-tracking-name-branch-only |
|
288 |
;; open magit status in same window as current buffer |
|
289 |
magit-status-buffer-switch-function 'switch-to-buffer |
|
290 |
;; highlight word/letter changes in hunk diffs |
|
291 |
magit-diff-refine-hunk t |
|
292 |
;; ask me if I want to include a revision when rewriting |
|
293 |
magit-rewrite-inclusive 'ask |
|
294 |
;; ask me to save buffers |
|
295 |
magit-save-some-buffers t |
|
296 |
;; pop the process buffer if we're taking a while to complete |
|
297 |
magit-process-popup-time 10 |
|
298 |
;; ask me if I want a tracking upstream |
|
299 |
magit-set-upstream-on-push 'askifnotset |
|
300 |
) |
|
301 |
(setq auto-package-update-delete-old-versions t) |
|
302 |
(setq auto-package-update-hide-results t) |
|
303 |
(auto-package-update-maybe))) |
5cb5f7
|
304 |
|
C |
305 |
;; flycheck |
707431
|
306 |
(use-package flycheck |
C |
307 |
:ensure t |
|
308 |
:init (global-flycheck-mode) |
|
309 |
:config |
|
310 |
(setq auto-package-update-delete-old-versions t) |
|
311 |
(setq auto-package-update-hide-results t) |
|
312 |
(auto-package-update-maybe)) |
5cb5f7
|
313 |
|
707431
|
314 |
(use-package flycheck-pos-tip |
C |
315 |
:ensure t |
|
316 |
:after flycheck |
|
317 |
:config |
|
318 |
(flycheck-pos-tip-mode) |
|
319 |
(setq auto-package-update-delete-old-versions t) |
|
320 |
(setq auto-package-update-hide-results t) |
|
321 |
(auto-package-update-maybe)) |
5cb5f7
|
322 |
|
2a15f9
|
323 |
(use-package flycheck-clang-analyzer |
C |
324 |
:ensure t |
|
325 |
:after flycheck |
|
326 |
:config |
|
327 |
(flycheck-clang-analyzer-setup) |
|
328 |
(setq auto-package-update-delete-old-versions t) |
|
329 |
(setq auto-package-update-hide-results t) |
|
330 |
(auto-package-update-maybe)) |
|
331 |
|
5cb5f7
|
332 |
;; nyan mode |
707431
|
333 |
(use-package nyan-mode |
C |
334 |
:if window-system |
|
335 |
:ensure t |
|
336 |
:config |
|
337 |
(nyan-mode)) |
5cb5f7
|
338 |
|
C |
339 |
;; semantic refactor |
2a15f9
|
340 |
(use-package semantic |
707431
|
341 |
:ensure t |
C |
342 |
:config |
2a15f9
|
343 |
(semantic-mode 1)) |
C |
344 |
|
|
345 |
(use-package srefactor |
|
346 |
:ensure t |
|
347 |
:bind (("M-RET o" . 'srefactor-lisp-one-line) |
|
348 |
("M-RET m" . 'srefactor-lisp-format-sexp) |
|
349 |
("M-RET d" . 'srefactor-lisp-format-defun) |
|
350 |
("M-RET b" . 'srefactor-lisp-format-buffer) |
|
351 |
:map c-mode-base-map |
|
352 |
("M-RET" . 'srefactor-refactor-at-point) |
|
353 |
:map c++-mode-map |
|
354 |
("M-RET" . 'srefactor-refactor-at-point)) |
|
355 |
:config |
707431
|
356 |
(setq auto-package-update-delete-old-versions t) |
C |
357 |
(setq auto-package-update-hide-results t) |
|
358 |
(auto-package-update-maybe)) |
5cb5f7
|
359 |
|
629a86
|
360 |
;; which-key |
C |
361 |
(use-package which-key |
707431
|
362 |
:ensure t |
C |
363 |
:config |
629a86
|
364 |
(which-key-mode) |
C |
365 |
(which-key-setup-side-window-bottom) |
707431
|
366 |
(setq auto-package-update-delete-old-versions t) |
C |
367 |
(setq auto-package-update-hide-results t) |
|
368 |
(auto-package-update-maybe)) |
8f6f27
|
369 |
|
a4b917
|
370 |
;; x86 lookup |
707431
|
371 |
(use-package x86-lookup |
C |
372 |
:ensure t |
|
373 |
:init |
|
374 |
(setq x86-lookup-pdf "D:/Coding/x86-instructions.pdf") |
|
375 |
:bind ("C-h x" . x86-lookup) |
|
376 |
:config |
|
377 |
(setq auto-package-update-delete-old-versions t) |
|
378 |
(setq auto-package-update-hide-results t) |
|
379 |
(auto-package-update-maybe)) |
8f6f27
|
380 |
|
c655ee
|
381 |
;; org-bullets |
707431
|
382 |
(use-package org-bullets |
C |
383 |
:ensure t |
|
384 |
:config |
9c4cf0
|
385 |
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) |
707431
|
386 |
(setq auto-package-update-delete-old-versions t) |
C |
387 |
(setq auto-package-update-hide-results t) |
|
388 |
(auto-package-update-maybe)) |
c655ee
|
389 |
|
a4b917
|
390 |
;; pdf-tools |
707431
|
391 |
(use-package pdf-tools |
C |
392 |
:ensure t |
|
393 |
:config |
|
394 |
(pdf-tools-install) |
|
395 |
(setq auto-package-update-delete-old-versions t) |
|
396 |
(setq auto-package-update-hide-results t) |
|
397 |
(auto-package-update-maybe)) |
|
398 |
|
2a15f9
|
399 |
;; org |
707431
|
400 |
(use-package org |
C |
401 |
:ensure t |
|
402 |
:config |
9c4cf0
|
403 |
(setq org-src-tab-acts-natively t) |
707431
|
404 |
(setq auto-package-update-delete-old-versions t) |
C |
405 |
(setq auto-package-update-hide-results t) |
|
406 |
(auto-package-update-maybe)) |
8f6f27
|
407 |
|
2a15f9
|
408 |
;; tex/AUCTex |
178ab9
|
409 |
(use-package tex |
C |
410 |
:ensure auctex |
|
411 |
:config |
2a15f9
|
412 |
(setq TeX-auto-save t) |
C |
413 |
(setq TeX-parse-self t) |
9c4cf0
|
414 |
(setq doc-view-ghostscript-program "c:/msys64/mingw64/bin/gswin32c.exe") |
C |
415 |
(setq preview-gs-command "c:/msys64/mingw64/bin/gs.exe") |
|
416 |
(setq auto-package-update-delete-old-versions t) |
|
417 |
(setq auto-package-update-hide-results t) |
|
418 |
(auto-package-update-maybe)) |
|
419 |
|
|
420 |
;; latex-preview-pane |
|
421 |
(use-package latex-preview-pane |
|
422 |
:ensure t |
|
423 |
:config |
|
424 |
(latex-preview-pane-enable) |
178ab9
|
425 |
(setq auto-package-update-delete-old-versions t) |
C |
426 |
(setq auto-package-update-hide-results t) |
|
427 |
(auto-package-update-maybe)) |
|
428 |
|
8f6f27
|
429 |
(custom-set-variables |
C |
430 |
;; custom-set-variables was added by Custom. |
|
431 |
;; If you edit it by hand, you could mess it up, so be careful. |
|
432 |
;; Your init file should contain only one such instance. |
|
433 |
;; If there is more than one, they won't work right. |
e75a20
|
434 |
'(custom-safe-themes |
C |
435 |
(quote |
|
436 |
("ec5f697561eaf87b1d3b087dd28e61a2fc9860e4c862ea8e6b0b77bd4967d0ba" default))) |
8f6f27
|
437 |
'(package-selected-packages |
C |
438 |
(quote |
9c4cf0
|
439 |
(company-math latex-preview-pane auctex zenburn-theme org flycheck-pos-tip flycheck rtags racket-mode geiser auto-package-update use-package pdf-tools org-bullets x86-lookup ztree yasnippet workgroups2 volatile-highlights undo-tree srefactor smartparens nyan-mode magit ibuffer-vc helm-projectile guide-key ggtags diff-hl company-c-headers clean-aindent-mode)))) |
8f6f27
|
440 |
(custom-set-faces |
C |
441 |
;; custom-set-faces was added by Custom. |
|
442 |
;; If you edit it by hand, you could mess it up, so be careful. |
|
443 |
;; Your init file should contain only one such instance. |
|
444 |
;; If there is more than one, they won't work right. |
|
445 |
) |