-
Notifications
You must be signed in to change notification settings - Fork 0
/
spacemacs
269 lines (238 loc) · 7.88 KB
/
spacemacs
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
;; -*- mode: dotspacemacs -*-
;; ================
;; Spacemacs config
;; ================
(defun dotspacemacs/layers ()
"Configuration Layers config"
(setq
; My own private layers are in "~/.emacs.d/spacemacs-layers/"
dotspacemacs-configuration-layer-path
'("~/.emacs.d/spacemacs-layers/")
dotspacemacs-configuration-layers
'(
; Contrib layers (included in spacemacs)
(version-control :variables
version-control-diff-tool 'diff-hl)
git
github
osx
dash
org
;; vim-empty-lines
ivy
(auto-completion :variables
company-idle-delay 0.1
auto-completion-private-snippets-directory "~/.emacs.d/snippets"
auto-completion-enable-help-tooltip t)
syntax-checking
(shell :variables
shell-default-shell 'multi-term
;; only used for term and ansi-term, but oh well...
shell-default-term-shell (or
(executable-find "/Users/ryanartecona/.nix-profile/bin/fish")
(executable-find "/usr/local/bin/fish")
(executable-find "fish")))
shell-scripts
;; (perspectives :variables
;; perspective-enable-persp-projectile t)
(spacemacs-layouts :variables
spacemacs-layouts-directory "~/.emacs.d/persps-layouts/"
layouts-enable-autosave nil
layouts-autosave-delay 1800)
gnus
; Langs
(ruby :variables
ruby-version-manager 'rvm
ruby-enable-ruby-on-rails-support t)
(haskell :variables
haskell-enable-shm-support t)
(html :variables
web-mode-markup-indent-offset 2
web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
scss-compile-at-save nil)
markdown
asciidoc
ocaml
emacs-lisp
lua
nixos
elixir
yaml
pandoc
nginx
javascript
purescript
agda
python
sql
csv
(reason :variables
reason-auto-refmt t)
(go :variables
go-tab-width 2)
; My own layer
ra
)
dotspacemacs-additional-packages
'(
ox-reveal
prettier-js
(merlin :location (recipe
:fetcher github
:repo "ocaml/merlin"
:commit "v2.5.4"
:files ("emacs/*.el")))
)
dotspacemacs-excluded-packages
'(
org-bullets
magit-gh-pulls
magithub
magit-gitflow
orgit
robe
anaconda-mode ; can't ever get this to not complain at me...
editorconfig
)
dotspacemacs-delete-orphan-packages t
dotspacemacs-enable-lazy-installation 'unused
dotspacemacs-ask-for-lazy-installation t
))
(defun dotspacemacs/init ()
"Called at the beginning of spacemacs configuration sequence"
(setq
dotspacemacs-themes
'(
solarized-light
solarized-dark
)
dotspacemacs-default-font
'(
;; "Menlo"
"PragmataPro"
:size 14
:weight normal
:width normal
:powerline-scale 1.4
)
dotspacemacs-directory "~/.emacs.d/spacemacs"
dotspacemacs-filepath "~/.spacemacs"
dotspacemacs-verbose-loading nil
dotspacemacs-startup-banner 'official
dotspacemacs-always-show-changelog t
dotspacemacs-startup-lists '(recents projects)
dotspacemacs-editing-style 'vim
dotspacemacs-leader-key "SPC"
dotspacemacs-emacs-leader-key "M-m"
dotspacemacs-major-mode-leader-key ","
dotspacemacs-major-mode-emacs-leader-key "C-M-m"
dotspacemacs-command-key ":"
dotspacemacs-which-key-delay 0.4
dotspacemacs-loading-progress-bar t
dotspacemacs-mode-line-unicode-symbols t
dotspacemacs-smooth-scrolling nil
dotspacemacs-persistent-server t
dotspacemacs-maximized-at-startup t
dotspacemacs-elpa-https t
dotspacemacs-check-for-update nil
dotspacemacs-startup-buffer-responsive t
dotspacemacs-emacs-command-key "SPC"
dotspacemacs-remap-Y-to-y$ nil
dotspacemacs-retain-visual-state-on-shift t
dotspacemacs-visual-line-move-text t
dotspacemacs-auto-save-file-location 'cache
dotspacemacs-helm-position 'bottom
dotspacemacs-helm-use-fuzzy 'always
dotspacemacs-enable-paste-transient-state t
dotspacemacs-switch-to-buffer-prefers-purpose nil
dotspacemacs-folding-method 'origami
)
(setq
; tabbing: 2 spaces
evil-shift-width 2
; org
org-startup-indented t
org-todo-keywords
'(
(sequence "PLAN(p)" "TODO(t)" "NEXT(n)" "|" "DONE(d)")
(sequence "STALE(s)" "BLOCKED(b@/!)" "VERIFY(v)" "|" "CANCELLED(c@/!)")
)
org-log-done 'time)
)
(defun dotspacemacs/user-init ()
;; This runs before spacemacs packages are loaded & configured
;; raise GC threshold to 200MB
(setq gc-cons-threshold 200000000)
;; save emacs sessions by default
;; (desktop-save-mode 1)
;; open new stuff in new graphical windows (instead of buffers)
;; (setq pop-up-frames 'graphic-only) ; opens too many frames, need to figure it out
(setq display-buffer-reuse-frames t
display-buffer-reuse-window t)
;; fix window scroll jumping when point moves near beginning/end of buffer
(setq auto-window-vscroll nil)
(setq system-uses-terminfo nil)
;; some solarized options
(setq solarized-distinct-fringe-background t)
(setq solarized-scale-org-headlines nil)
(setq solarized-use-variable-pitch nil)
(setq solarized-high-contrast-mode-line t)
;; may be unnecessary...
;; (setq solarized-height-minus-1 1)
;; (setq solarized-height-plus-1 1)
;; (setq solarized-height-plus-2 1)
;; (setq solarized-height-plus-3 1)
;; (setq solarized-height-plus-4 1)
)
(defun dotspacemacs/user-config ()
"Called at the end of spacemacs configuration sequence"
(setq powerline-default-separator nil)
; enable left fringe, disable right fringe
(fringe-mode '(nil . 0))
(setq diff-hl-side 'left)
; enable and load workgroups session
;; (setq wg-session-file "~/.emacs.d/.emacs_workgroups")
;; (workgroups-mode 1)
(golden-ratio-mode 1)
; turn off ido-mode, so plugins (workgroups) don't think it's
; preferred to helm or ivy
(ido-mode -1)
; turn on which-key
(which-key-mode 1)
; turn off clean-aindent-mode
(clean-aindent-mode -1)
(global-company-mode 1)
; don't spam the system clipboard with visual selections
(fset 'evil-visual-update-x-selection 'ignore)
(when (equal system-type 'darwin)
;; Make some OSX idioms work
(global-set-key (kbd "s-n") 'make-frame-command)
(global-set-key (kbd "s-a") 'mark-whole-buffer)
(global-set-key (kbd "s-w") 'delete-window)
(global-set-key (kbd "s-<right>") 'evil-end-of-line)
(global-set-key (kbd "s-<left>") 'evil-first-non-blank)
(global-set-key (kbd "H-<up>") 'evil-window-up)
(global-set-key (kbd "H-<down>") 'evil-window-down)
(global-set-key (kbd "H-<left>") 'evil-window-left)
(global-set-key (kbd "H-<right>") 'evil-window-right)
(global-set-key (kbd "M-DEL") 'evil-delete-backward-word)
)
;; This stuff is to ansi-colorize the compilation buffer after a rails test so the terminal colors come through.
(define-derived-mode ansi-compilation-mode compilation-mode "ansi compilation"
"Compilation mode that understands ansi colors."
(require 'ansi-color)
(let ((inhibit-read-only 1))
(ansi-color-apply-on-region (point-min) (point-max))))
(defun colorize-compilation (one two)
"ansi colorize the compilation buffer."
(ansi-compilation-mode)
)
(setq compilation-finish-function 'colorize-compilation)
; This is available in iTerm but not ansi-term, and its absence
; breaks e.g. ruby scripts run from ansi-term
(setenv "LANG" "en_US.UTF-8")
(unless (server-running-p)
(server-start)
)
)