-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
138 lines (117 loc) · 3.94 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
;;; package --- Summary:
;;; Commentary:
;;; Code:
(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.
'(custom-safe-themes
(quote
("a24c5b3c12d147da6cef80938dca1223b7c7f70f2f382b26308eba014dc4833a" "0bff60fb779498e69ea705825a2ca1a5497a4fccef93bf3275705c2d27528f2f" "3f44e2d33b9deb2da947523e2169031d3707eec0426e78c7b8a646ef773a2077" "2540689fd0bc5d74c4682764ff6c94057ba8061a98be5dd21116bf7bf301acfb" "d8dc153c58354d612b2576fea87fe676a3a5d43bcc71170c62ddde4a1ad9e1fb" default)))
'(package-selected-packages
(quote
(flycheck-irony company-irony company flycheck afternoon-theme magit solarized-theme solarized color-theme auto-complete org-bullets which-key use-package try))))
(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.
)
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
;; use-package: a package that makes it easy to install other packages
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; try: a package that lets you try packages without installing them
(use-package try
:ensure t)
(use-package which-key
:ensure t
:config (which-key-mode))
;; Org-mode stuff
(use-package org-bullets
:ensure t
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
(add-hook 'org-mode-hook '(lambda () (setq fill-column 80)))
(add-hook 'org-mode-hook 'turn-on-auto-fill)
;; Make windmove work in org-mode:
(setq org-disputed-keys '(([(shift up)] . [(meta p)])
([(shift down)] . [(meta n)])
([(shift left)] . [(meta -)])
([(shift right)] . [(meta +)])
([(meta return)] . [(control meta return)])
([(control shift right)] . [(meta shift +)])
([(control shift left)] . [(meta shift -)])))
(setq org-replace-disputed-keys t)
;; Auto complete
;;(use-package auto-complete
;; :ensure t
;; :init
;; (progn
;; (ac-config-default)
;; (global-auto-complete-mode t)
;; ))
;; Irony mode
(use-package irony
:ensure t
:config
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
;; Company
(use-package company
:ensure t
:config
(add-hook 'after-init-hook 'global-company-mode))
;; Company-irony
(use-package company-irony
:ensure t
:config
(add-to-list 'company-backends 'company-irony))
;; Company-c-headers (for c and c++ headers completion)
(use-package company-c-headers
:ensure t
:config
(add-to-list 'company-backends 'company-c-headers))
;; Python autocompletion
(use-package company-jedi
:ensure t
:config
(defun jedi-python-mode-hook ()
(add-to-list 'company-backends 'company-jedi))
(add-hook 'python-mode-hook 'jedi-python-mode-hook))
;; Flycheck
(use-package flycheck
:ensure t
:config (global-flycheck-mode t))
;; Flycheck-irony
(use-package flycheck-irony
:ensure t
:config
(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
;; Themes
(use-package monokai-theme
:ensure t
:config (load-theme 'monokai t))
;; Git porcelain
(use-package magit
:ensure t
:bind (("C-x g" . magit-status)))
;; Misc
(global-hl-line-mode t)
(windmove-default-keybindings)
(scroll-bar-mode -1)
;; c-mode
(add-hook 'c-mode-hook 'electric-pair-mode)
(provide 'init)
;;; init.el ends here