-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
241 lines (202 loc) · 7.68 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
;;; package --- Summary
;;; Commentary:
;;; Code:
;; (setq debug-on-quit t)
(load-theme 'tango-dark t)
;; strip down default memory/fileio settings for fast startup
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
;; Keeps customizations out of init.el
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(write-region "" nil custom-file 1)
(load custom-file)
;; Turn down the garbage collector during the loading of this file in case use-package
;; has do some compiling. Set it back when done with init.
(setq gc-cons-threshold 64000000)
(add-hook 'after-init-hook #'(lambda ()
;; restore after startup
(setq gc-cons-threshold 800000)))
;; Melpa
(setq package-check-signature nil)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
;; (setq package-archive-priorities (quote (("melpa" . 5) ("melpa-stable" . 10))))
;; Do not activate initialized packages until all the loading is done below,
;; in order to allow missing packages to be loaded before activating dependents
(package-initialize t)
;; END Melpa
;;;;;;;;
;; START Packages
;;;;;;;;
;; External requirements:
;; Python:
;; sudo pip2.7 install flake8
;; sudo pip2.7 install jedi
;; sudo pip2.7 install epc
;; sudo snap install pyright --classic
;; rtags:
;; brew install rtags
;; or
;; apt-get install rtags
;; cmake:
;; pip3 install cmake-language-server
;; go
;; # go-mode
;; go get github.com/rogpeppe/godef
;; # go-autocomplete
;; go get -u github.com/nsf/gocode
;; # go-imports
;; go get golang.org/x/tools/cmd/goimports
;; # go-guru
;; go get golang.org/x/tools/cmd/guru
;;
;; Add to .bashrc:
;; export GOROOT=/usr/local/opt/go/libexec
;; export GOPATH=~/go-workspace
;; export PATH=$PATH:$GOROOT/bin
;; export PATH=$PATH:$GOPATH/bin
;; edbi:
;; brew install perl
;; brew install mysql
;; brew install mysql-connector-c
;; cpan RPC::EPC::Service DBI DBD::SQLite DBD::Pg DBD::mysql
;; Add to .bashrc:
;; source ~/perl5/perlbrew/etc/bashrc
;; export PERL5LIB=~/perl5/lib/perl5
(defconst osx-installed-packages
'(
;; Basic OSX sanity
exec-path-from-shell ;; Copies OSX exec environment into .app version of Emacs
)
)
(defconst my-installed-packages
'(
;; ide-code-completion/syntax checking
company ;; auto-complete powered by various backends
flycheck ;; syntax checking powered by various backends
flycheck-tip ;; show flycheck errors as tooltips
rtags ;; backend clang-based autocomplete, syntax check & navigation. Requires installation of binary
helm-rtags
flycheck-rtags
company-rtags
dumb-jump ;; "good enough" code navigation (based on projectile, ag, no config)
;; Project-stuff
projectile ;; project-based navigation & searching
helm ;; fancy-pants results searching - used in many contexts
helm-projectile ;; integration with helm & projectile
helm-swoop ;; interactive search result browsing
magit ;; git integration
git-messenger ;; fancy git quality-of-life stuff
cmake-mode ;; for CMakeLists.txt files
git-timemachine ;; browse git history
;; Python
blacken ;; code formatter
poetry ;; environment management
py-autopep8 ;; for pep8 enforcement
ein ;; for Jupyter
;; c-sharp
;; omnisharp-emacs ;; c# ide server
;; Go
go-mode
go-autocomplete
;; Db
;; edbi ;; more graphical version of db explorer
;; omnisharp is disabled as we're loading from a local branch
omnisharp ;; c# ide server
shut-up ;; for omnisharp-emacs
;; Text-Editing Stuff
comment-dwim-2 ;; Better options for commenting using M-;
ws-butler ;; smartly removes trailing whitespace
iedit ;; Hit C-; to highlight & edit all occurrences of symbol
volatile-highlights ;; highlights changes from undo/replace/etc until keystroke
clang-format ;; Formats code using clang-format. Requires installation of binary
yasnippet ;; Snippet shortcuts. yas-describe-tables for list
yasnippet-snippets ;; the actual snippets
helm-c-yasnippet ;; Use helm to navigate available snippets with helm-yas-complete
expand-region ;; Use M-m to increase the current selection to the next-largest lexical unit
itail ;; Tail changing files
;; file-type modes
flymd
;; Other improvements
groovy-mode
helm-ag ;; use M-x helm-ag for more powerful searching
load-relative ;; load-relative is like load, only you can use relative paths
ag ;; needed by other modes that use ag (silver searcher)
use-package ;; easier package configuration
which-key ;; adds help completion for compound
json-mode ;; for Json files
yafolding ;; code-folding for a variety of formats
el-get ;; Get historical versions of elpa packages
neotree ;; Display a sidebar for file navigation
string-inflection ;; cycle between capitalization conventions
ligature ;; font ligature support
;; These are an alternative to rtags - use for non-clang platforms
;; cmake-ide disabled because of extreme slowness; rtags now self-configures,
;; as long as we generate a compile_commands.json file and run "rc -J ." in
;; the build dir
;; cmake-ide ;; configures flycheck, rtags & others based on current cmake project
;;
;; helm-gtags
;; ggtags
))
(defun install-packages ()
"Install all required packages."
(interactive)
(unless package-archive-contents
(package-refresh-contents))
(dolist (package my-installed-packages)
(unless (package-installed-p package)
(package-install package)))
(if (eq system-type 'darwin)
(dolist (package osx-installed-packages)
(unless (package-installed-p package)
(package-install package)))
)
)
(install-packages)
;;;;;;;;
;; END Packages
;;;;;;;;
(require 'load-relative)
;; (byte-recompile-directory (relative-expand-file-name "."))
(add-to-list 'load-path "~/.emacs.d/my-packages")
(load-relative "./config-iedit")
(load-relative "./config-garbage-collector")
(load-relative "./config-exec-path-from-shell")
(load-relative "./config-company")
(load-relative "./config-rtags")
(load-relative "./config-flycheck")
(load-relative "./config-clang-format")
(load-relative "./config-yasnippet")
(load-relative "./config-projectile")
(load-relative "./config-volatile-highlights")
(load-relative "./config-ws-butler")
(load-relative "./config-helm")
(load-relative "./config-magit")
(load-relative "./config-git-messenger")
(load-relative "./config-helm-swoop")
(load-relative "./config-python")
(load-relative "./config-expand-region")
(load-relative "./config-csharp")
(load-relative "./config-which-key")
(load-relative "./config-git-timemachine")
(load-relative "./config-perl")
(load-relative "./config-sql")
(load-relative "./config-go")
(load-relative "./config-org")
(load-relative "./config-dumb-jump")
(load-relative "./config-flymd")
(load-relative "./config-neotree")
(load-relative "./config-string-inflection")
(load-relative "./config-ligature")
(if (eq system-type 'darwin)
(load-relative "./gud")
)
(load-relative "./smb-options")
;; Restore default memory/fileio settings
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1)
(set-language-environment "UTF-8")
;;; init.el ends here
(put 'narrow-to-region 'disabled nil)