rc

First motions towards quitting use of Spacemacs

Author
Maarten Vangeneugden
Date
Oct. 24, 2018, 1:29 p.m.
Hash
cb2f4e603f7769f6ed0791c79d1a8b31dc4bfd9d
Parent
77f20f96e56de6fffddd5909f179e89589ddc15b
Modified file
.spacemacs

.spacemacs

1 addition and 0 deletions.

View changes Hide changes
+
1
;; -*- mode: emacs-lisp -*-
1
2
;; This file is loaded by Spacemacs at startup.
2
3
;; It must be stored in your home directory.
3
4
;;;; Local
4
5
(setq is-linuxp (eq system-type 'gnu/linux))
5
6
(defun os-path (x) (if is-linuxp x (expand-file-name x "c:")))
6
7
7
8
;;;; Core
8
9
9
10
(defvar dotspacemacs/layers/core
10
11
  '(
11
12
    git
12
13
    org ;; :variables
13
14
         ;;org-agenda-files '(
14
15
                            ;;"~/University/"
15
16
                            ;;"~/Repositories/private/org/"
16
17
                            ;;"~/University/COMPN/"))
17
18
    syntax-checking
18
19
    (auto-completion :variables
19
20
                     auto-completion-return-key-behavior 'complete
20
21
                     auto-completion-tab-key-behavior 'cycle
21
22
                     auto-completion-enable-snippets-in-popup t
22
23
                     auto-completion-complete-with-key-sequence-delay nil)
23
24
    ycmd
24
25
    helm
25
26
    (version-control :variables
26
27
                     version-control-global-margin t
27
28
                     version-control-diff-tool 'git-gutter+)
28
29
    )
29
30
  "Layers I consider core to Spacemacs")
30
31
31
32
;; Langs
32
33
33
34
(defvar dotspacemacs/layers/langs
34
35
  '(emacs-lisp
35
36
    (html :variables
36
37
          web-mode-enable-auto-pairing nil
37
38
          web-mode-enable-auto-closing nil
38
39
          web-mode-enable-auto-expanding nil
39
40
          web-mode-enable-auto-opening nil
40
41
          web-mode-enable-auto-quoting nil)
41
42
42
43
    markdown
43
44
    csv
44
45
    yaml
45
46
    ;rust
46
47
    (clojure :variables
47
48
             clojure-enable-fancify-symbols t)
48
49
    (haskell :variables
49
50
             haskell-completion-backend 'intero)
50
51
    (python :variables
51
52
            python-sort-imports-on-save t
52
53
            python-test-runner 'pytest)
53
54
    )
54
55
  "Programming and markup language layers")
55
56
56
57
;;;; Extra
57
58
58
59
(defvar dotspacemacs/layers/extra
59
60
  '(gnus
60
61
    graphviz
61
62
    themes-megapack
62
63
    ;; TODO: Needs configuration: http://spacemacs.org/layers/+themes/theming/README.html
63
64
    theming
64
65
    mu4e)
65
66
  "Miscellaneous layers")
66
67
67
68
(defun dotspacemacs/layers ()
68
69
  "Configuration Layers declaration.
69
70
You should not put any user code in this function besides modifying the variable
70
71
values."
71
72
  (setq-default
72
73
   ;; Base distribution to use. This is a layer contained in the directory
73
74
   ;; `+distribution'. For now available distributions are `spacemacs-base'
74
75
   ;; or `spacemacs'. (default 'spacemacs)
75
76
   dotspacemacs-distribution 'spacemacs
76
77
   ;; Lazy installation of layers (i.e. layers are installed only when a file
77
78
   ;; with a supported type is opened). Possible values are `all', `unused'
78
79
   ;; and `nil'. `unused' wilIn addition, we will also organise a second review moment on 30 November which will deal with broader code issues, such as OO structure, comments, naming, code style, robustness, logging, etc. (for preparation and inspiration, see http://www.phpied.com/how-to-write-unmaintainable-php-code-2009/)
79
80
80
81
   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
81
82
   ;; lazy iELPAnstall any layer that support lazy installation even the layers
82
83
   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
83
84
   ;; installation feature and you have to explicitly list a layer in the
84
85
   ;; variable `dotspacemacs-configuration-layers' to install it.
85
86
   ;; (default 'unused)
86
87
   dotspacemacs-enable-lazy-installation 'unused
87
88
   ;; If non-nil then Spacemacs will ask for confirmation before installing
88
89
   ;; a layer lazily. (default t)
89
90
   dotspacemacs-ask-for-lazy-installation t
90
91
   ;; If non-nil layers with lazy install support are lazy installed.
91
92
   ;; List of additional paths where to look for configuration layers.
92
93
   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
93
94
   dotspacemacs-configuration-layer-path `(,(os-path "~/.emacs.d/layers/"))
94
95
   ;; List of configuration layers to load.
95
96
   dotspacemacs-configuration-layers (append
96
97
                                         dotspacemacs/layers/core
97
98
                                         dotspacemacs/layers/langs
98
99
                                         dotspacemacs/layers/extra)
99
100
   ;; List of additional packages that will be installed without being
100
101
   ;; wrapped in a layer. If you need some configuration for these
101
102
   ;; packages, then consider creating a layer. You can also put the
102
103
   ;; configuration in `dotspacemacs/user-config'.
103
104
   dotspacemacs-additional-packages '(
104
105
    markdown-mode
105
106
    ;;po-mode  ;;Commented until I find a way to disable the FUCKING ANNOYING READONLY MODE
106
107
    (pretty-mode :location (recipe :fetcher github :repo "akatov/pretty-mode"))
107
108
    (prettify-utils :location (recipe :fetcher github :repo "Ilazki/prettify-utils.el"))
108
109
    (company-mode :location (recipe :fetcher github :repo "company-mode/company-mode"))
109
110
    (emacs-ycmd :location (recipe :fetcher github :repo "abingham/emacs-ycmd"))
110
111
    (company-flx :location (recipe :fetcher github :repo "PythonNut/company-flx")))
111
112
112
113
   ;; A list of packages that cannot be updated.
113
114
   dotspacemacs-frozen-packages '()
114
115
   ;; A list of packages that will not be installed and loaded.
115
116
   dotspacemacs-excluded-packages '(
116
117
                                    smartparens
117
118
                                    exec-path-from-shell)
118
119
   ;; Defines the behaviour of Spacemacs when installing packages.
119
120
   ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
120
121
   ;; `used-only' installs only explicitly used packages and uninstall any
121
122
   ;; unused packages as well as their unused dependencies.
122
123
   ;; `used-but-keep-unused' installs only the used packages but won't uninstall
123
124
   ;; them if they become unused. `all' installs *all* packages supported by
124
125
   ;; Spacemacs and never uninstall them. (default is `used-only')
125
126
   dotspacemacs-install-packages 'used-only))
126
127
127
128
(defun dotspacemacs/init ()
128
129
  "Initialization function.
129
130
This function is called at the very startup of Spacemacs initialization
130
131
before layers configuration.
131
132
You should not put any user code in there besides modifying the variable
132
133
values."
133
134
  ;; This setq-default sexp is an exhaustive list of all the supported
134
135
  ;; spacemacs settings.
135
136
  (setq-default
136
137
   ;; If non nil ELPA repositories are contacted via HTTPS whenever it's
137
138
   ;; possible. Set it to nil if you have no way to use HTTPS in your
138
139
   ;; environment, otherwise it is strongly recommended to let it set to t.
139
140
   ;; This variable has no effect if Emacs is launched with the parameter
140
141
   ;; `--insecure' which forces the value of this variable to nil.
141
142
   ;; (default t)
142
143
   dotspacemacs-elpa-https t
143
144
   ;; Maximum allowed time in seconds to contact an ELPA repository.
144
145
   dotspacemacs-elpa-timeout 5
145
146
   ;; If non nil then spacemacs will check for updates at startup
146
147
   ;; when the current branch is not `develop'. Note that checking for
147
148
   ;; new versions works via git commands, thus it calls GitHub services
148
149
   ;; whenever you start Emacs. (default nil)
149
150
   dotspacemacs-check-for-update nil
150
151
   ;; If non-nil, a form that evaluates to a package directory. For example, to
151
152
   ;; use different package directories for different Emacs versions, set this
152
153
   ;; to `emacs-version'.
153
154
   dotspacemacs-elpa-subdirectory nil
154
155
   ;; One of `vim', `emacs' or `hybrid'.
155
156
   ;; `hybrid' is like `vim' except that `insert state' is replaced by the
156
157
   ;; `hybrid state' with `emacs' key bindings. The value can also be a list
157
158
   ;; with `:variables' keyword (similar to layers). Check the editing styles
158
159
   ;; section of the documentation for details on available variables.
159
160
   ;; (default 'vim)
160
161
   dotspacemacs-editing-style 'vim
161
162
   ;; If non nil output loading progress in `*Messages*' buffer. (default nil)
162
163
   dotspacemacs-verbose-loading nil
163
164
   ;; Specify the startup banner. Default value is `official', it displays
164
165
   ;; the official spacemacs logo. An integer value is the index of text
165
166
   ;; banner, `random' chooses a random text banner in `core/banners'
166
167
   ;; directory. A string value must be a path to an image format supported
167
168
   ;; by your Emacs build.
168
169
   ;; If the value is nil then no banner is displayed. (default 'official)
169
170
   dotspacemacs-startup-banner 'official
170
171
   ;; List of items to show in startup buffer or an association list of
171
172
   ;; the form `(list-type . list-size)`. If nil then it is disabled.
172
173
   ;; Possible values for list-type are:
173
174
   ;; `recents' `bookmarks' `projects' `agenda' `todos'."
174
175
   ;; List sizes may be nil, in which case
175
176
   ;; `spacemacs-buffer-startup-lists-length' takes effect.
176
177
   dotspacemacs-startup-lists '((recents . 5)
177
178
                                (projects . 7))
178
179
   ;; True if the home buffer should respond to resize events.
179
180
   dotspacemacs-startup-buffer-responsive t
180
181
   ;; Default major mode of the scratch buffer (default `text-mode')
181
182
   dotspacemacs-scratch-mode 'text-mode
182
183
   ;; List of themes, the first of the list is loaded when spacemacs starts.
183
184
   ;; Press  T n to cycle to the next theme in the list (works great
184
185
   ;; with 2 themes variants, one dark and one light)
185
186
   dotspacemacs-themes '(monokai
186
187
                         solarized-dark
187
188
                         solarized-light)
188
189
   ;; If non nil the cursor color matches the state color in GUI Emacs.
189
190
   dotspacemacs-colorize-cursor-according-to-state t
190
191
   ;; Default font, or prioritized list of fonts. `powerline-scale' allows to
191
192
   ;; quickly tweak the mode-line size to make separators look not too crappy.
192
193
   dotspacemacs-default-font '("Hack"
193
194
                               :size 15
194
195
                               :weight normal
195
196
                               :width normal
196
197
                               :powerline-scale 1.5)
197
198
   ;; The leader key
198
199
   dotspacemacs-leader-key "SPC"
199
200
   ;; The key used for Emacs commands (M-x) (after pressing on the leader key).
200
201
   ;; (default "SPC")
201
202
   dotspacemacs-emacs-command-key "SPC"
202
203
   ;; The key used for Vim Ex commands (default ":")
203
204
   dotspacemacs-ex-command-key ":"
204
205
   ;; The leader key accessible in `emacs state' and `insert state'
205
206
   ;; (default "M-m")
206
207
   dotspacemacs-emacs-leader-key "M-m"
207
208
   ;; Major mode leader key is a shortcut key which is the equivalent of
208
209
   ;; pressing ` m`. Set it to `nil` to disable it. (default ",")
209
210
   dotspacemacs-major-mode-leader-key ","
210
211
   ;; Major mode leader key accessible in `emacs state' and `insert state'.
211
212
   ;; (default "C-M-m")
212
213
   dotspacemacs-major-mode-emacs-leader-key "C-M-m"
213
214
   ;; These variables control whether separate commands are bound in the GUI to
214
215
   ;; the key pairs C-i, TAB and C-m, RET.
215
216
   ;; Setting it to a non-nil value, allows for separate commands under 
216
217
   ;; and TAB or  and RET.
217
218
   ;; In the terminal, these pairs are generally indistinguishable, so this only
218
219
   ;; works in the GUI. (default nil)
219
220
   dotspacemacs-distinguish-gui-tab nil
220
221
   ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
221
222
   dotspacemacs-remap-Y-to-y$ nil
222
223
   ;; If non-nil, the shift mappings `<' and `>' retain visual state if used
223
224
   ;; there. (default t)
224
225
   dotspacemacs-retain-visual-state-on-shift t
225
226
   ;; If non-nil, J and K move lines up and down when in visual mode.
226
227
   ;; (default nil)
227
228
   dotspacemacs-visual-line-move-text nil
228
229
   ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
229
230
   ;; (default nil)
230
231
   dotspacemacs-ex-substitute-global nil
231
232
   ;; Name of the default layout (default "Default")
232
233
   dotspacemacs-default-layout-name "Default"
233
234
   ;; If non nil the default layout name is displayed in the mode-line.
234
235
   ;; (default nil)
235
236
   dotspacemacs-display-default-layout nil
236
237
   ;; If non nil then the last auto saved layouts are resume automatically upon
237
238
   ;; start. (default nil)
238
239
   dotspacemacs-auto-resume-layouts nil
239
240
   ;; Size (in MB) above which spacemacs will prompt to open the large file
240
241
   ;; literally to avoid performance issues. Opening a file literally means that
241
242
   ;; no major mode or minor modes are active. (default is 1)
242
243
   dotspacemacs-large-file-size 1
243
244
   ;; Location where to auto-save files. Possible values are `original' to
244
245
   ;; auto-save the file in-place, `cache' to auto-save the file to another
245
246
   ;; file stored in the cache directory and `nil' to disable auto-saving.
246
247
   ;; (default 'cache)
247
248
   dotspacemacs-auto-save-file-location 'cache
248
249
   ;; Maximum number of rollback slots to keep in the cache. (default 5)
249
250
   dotspacemacs-max-rollback-slots 5
250
251
   ;; If non nil, `helm' will try to minimize the space it uses. (default nil)
251
252
   dotspacemacs-helm-resize nil
252
253
   ;; if non nil, the helm header is hidden when there is only one source.
253
254
   ;; (default nil)
254
255
   dotspacemacs-helm-no-header nil
255
256
   ;; define the position to display `helm', options are `bottom', `top',
256
257
   ;; `left', or `right'. (default 'bottom)
257
258
   dotspacemacs-helm-position 'bottom
258
259
   ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
259
260
   ;; in all non-asynchronous sources. If set to `source', preserve individual
260
261
   ;; source settings. Else, disable fuzzy matching in all sources.
261
262
   ;; (default 'always)
262
263
   dotspacemacs-helm-use-fuzzy 'always
263
264
   ;; If non nil the paste micro-state is enabled. When enabled pressing `p`
264
265
   ;; several times cycle between the kill ring content. (default nil)
265
266
   dotspacemacs-enable-paste-transient-state nil
266
267
   ;; Which-key delay in seconds. The which-key buffer is the popup listing
267
268
   ;; the commands bound to the current keystroke sequence. (default 0.4)
268
269
   dotspacemacs-which-key-delay 0
269
270
   ;; Which-key frame position. Possible values are `right', `bottom' and
270
271
   ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
271
272
   ;; right; if there is insufficient space it displays it at the bottom.
272
273
   ;; (default 'bottom)
273
274
   dotspacemacs-which-key-position 'bottom
274
275
   ;; If non nil a progress bar is displayed when spacemacs is loading. This
275
276
   ;; may increase the boot time on some systems and emacs builds, set it to
276
277
   ;; nil to boost the loading time. (default t)
277
278
   dotspacemacs-loading-progress-bar t
278
279
   ;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
279
280
   ;; (Emacs 24.4+ only)
280
281
   dotspacemacs-fullscreen-at-startup nil
281
282
   ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
282
283
   ;; Use to disable fullscreen animations in OSX. (default nil)
283
284
   dotspacemacs-fullscreen-use-non-native nil
284
285
   ;; des dired-mode
285
286
   ;;                       doc-view-mode
286
287
   ;;                       markdown-mode
287
288
   ;;                       org-mode
288
289
   ;;                       pdf-view-mode
289
290
   ;;                       text-mode
290
291
   ;;   :size-limit-kb 1000)
291
292
   ;; (default nil)
292
293
   dotspacemacs-line-numbers 'relative
293
294
   ;; Code folding method. Possible values are `evil' and `origami'.
294
295
   ;; (default 'evil)
295
296
   dotspacemacs-folding-method 'evil
296
297
   ;; If non-nil smartparens-strict-mode will be enabled in programming modes.
297
298
   ;; (default nil)
298
299
   dotspacemacs-smartparens-strict-mode nil
299
300
   ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
300
301
   ;; over any automatically added closing parenthesis, bracket, quote, etc…
301
302
   ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
302
303
   dotspacemacs-smart-closing-parenthesis nil
303
304
   ;; Select a scope to highlight delimiters. Possible values are `any',
304
305
   ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
305
306
   ;; emphasis the current one). (default 'all)
306
307
   dotspacemacs-highlight-delimiters 'all
307
308
   ;; If non nil, advise quit functions to keep server open when quitting.
308
309
   ;; (default nil)
309
310
   dotspacemacs-persistent-server nil
310
311
   ;; List of search tool executable names. Spacemacs uses the first installed
311
312
   ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
312
313
   ;; (default '("ag" "pt" "ack" "grep"))
313
314
   dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
314
315
   ;; The default package repository used if no explicit repository has been
315
316
   ;; specified with an installed package.
316
317
   ;; Not used for now. (default nil)
317
318
   dotspacemacs-default-package-repository nil
318
319
   ;; Delete whitespace while saving buffer. Possible values are `all'
319
320
   ;; to aggressively delete empty line and long sequences of whitespace,
320
321
   ;; `trailing' to delete only the whitespace at end of lines, `changed'to
321
322
   ;; delete only whitespace for changed lines or `nil' to disable cleanup.
322
323
   ;; (default nil)
323
324
   dotspacemacs-whitespace-cleanup nil
324
325
   ))
325
326
326
327
(defun dotspacemacs/user-init ()
327
328
  (add-hook 'text-mode-hook #'auto-fill-mode)
328
329
;;; Fira code
329
330
;; This works when using emacs --daemon + emacsclient
330
331
(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")))
331
332
;; This works when using emacs without server/client
332
333
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")
333
334
;; I haven't found one statement that makes both of the above situations work, so I use both for now
334
335
335
336
;; All possible Fira code symbols. I've commented some for historical purposes,
336
337
;; and only left the ones I do want to see. They may be removed one day, but for
337
338
;; now, they'll stay here.
338
339
;; I generally only use the ones that actually give new symbols based on their
339
340
;; ligature. ";;" is just the same symbol mashed together, so I don't use that.
340
341
(defconst fira-code-font-lock-keywords-alist
341
342
  (mapcar (lambda (regex-char-pair)
342
343
            `(,(car regex-char-pair)
343
344
              (0 (prog1 ()
344
345
                   (compose-region (match-beginning 1)
345
346
                                   (match-end 1)
346
347
                                   ;; The first argument to concat is a string containing a literal tab
347
348
                                   ,(concat "	" (list (decode-char 'ucs (cadr regex-char-pair)))))))))
348
349
          '(;("[^/]\\(\\*\\*\\)[^/]"        #Xe101)
349
350
            ;("[^*]\\(\\*/\\)"              #Xe105)
350
351
            ;("\\(\\\\\\\\\\)"              #Xe106)
351
352
            ("\\({-\\)"                    #Xe108)
352
353
            ;("\\(\\[\\]\\)"                #Xe109)
353
354
            ;("[^=]\\(:=\\)"                #Xe10c)
354
355
            ("\\(!=\\)"                    #Xe10e)
355
356
            ("\\(!==\\)"                   #Xe10f)
356
357
            ("\\(-}\\)"                    #Xe110)
357
358
            ("\\(-->\\)"                   #Xe113)
358
359
            ("[^-]\\(->\\)"                #Xe114)
359
360
            ("\\(->>\\)"                   #Xe115)
360
361
            ("\\(-<\\)"                    #Xe116)
361
362
            ("\\(-<<\\)"                   #Xe117)
362
363
            ("\\(-~\\)"                    #Xe118)
363
364
            ("\\(\\.-\\)"                  #Xe122)
364
365
            ("\\(\\.=\\)"                  #Xe123)
365
366
            ("\\(/=\\)"                    #Xe12c)
366
367
            ("\\(/==\\)"                   #Xe12d)
367
368
            ("\\(|>\\)"                    #Xe135)
368
369
            ("[^!/]\\(==\\)[^>]"           #Xe13c)
369
370
            ("\\(===\\)"                   #Xe13d)
370
371
            ("\\(==>\\)"                   #Xe13e)
371
372
            ("[^=]\\(=>\\)"                #Xe13f)
372
373
            ("\\(=>>\\)"                   #Xe140)
373
374
            ("\\(<=\\)"                    #Xe141)
374
375
            ("\\(=<<\\)"                   #Xe142)
375
376
            ("\\(=/=\\)"                   #Xe143)
376
377
            ("\\(>-\\)"                    #Xe144)
377
378
            ("\\(>=\\)"                    #Xe145)
378
379
            ("\\(>=>\\)"                   #Xe146)
379
380
            ;("[^-=]\\(>>\\)"               #Xe147)
380
381
            ("\\(>>-\\)"                   #Xe148)
381
382
            ("\\(>>=\\)"                   #Xe149)
382
383
            ("\\(<|\\)"                    #Xe14d)
383
384
            ("\\(<|>\\)"                   #Xe14e)
384
385
            ("\\(<-\\)"                    #Xe152)
385
386
            ("\\(<--\\)"                   #Xe153)
386
387
            ("\\(<->\\)"                   #Xe154)
387
388
            ("\\(<=\\)"                    #Xe157)
388
389
            ("\\(<==\\)"                   #Xe158)
389
390
            ("\\(<=>\\)"                   #Xe159)
390
391
            ("\\(<=<\\)"                   #Xe15a)
391
392
            ("\\(<>\\)"                    #Xe15b)
392
393
            ;("[^-=]\\(<<\\)"               #Xe15c)
393
394
            ("\\(<<-\\)"                   #Xe15d)
394
395
            ("\\(<<=\\)"                   #Xe15e)
395
396
            ("\\(<<<\\)"                   #Xe15f)
396
397
            ("\\(<~\\)"                    #Xe160)
397
398
            ("\\(<~~\\)"                   #Xe161)
398
399
            ("\\(~@\\)"                    #Xe164)
399
400
            ("\\(~-\\)"                    #Xe165)
400
401
            ("\\(~=\\)"                    #Xe166)
401
402
            ("\\(~>\\)"                    #Xe167)
402
403
            ("[^<]\\(~~\\)"                #Xe168)
403
404
            ("\\(~~>\\)"                   #Xe169)
404
405
            ("[^:=]\\(:\\)[^:=]"           #Xe16c)
405
406
            ("[^\\+<>]\\(\\+\\)[^\\+<>]"   #Xe16d)
406
407
            ("[^\\*/<>]\\(\\*\\)[^\\*/<>]" #Xe16f))))
407
408
408
409
(defun add-fira-code-symbol-keywords ()
409
410
  (font-lock-add-keywords nil fira-code-font-lock-keywords-alist))
410
411
411
412
(add-hook 'prog-mode-hook
412
413
          #'add-fira-code-symbol-keywords)
413
414
  "Initialization function for user code.
414
415
It is called immediately after `dotspacemacs/init', before layer configuration
415
416
executes.
416
417
 This function is mostly useful for variables that need to be set
417
418
before packages are loaded. If you are unsure, you should try in setting them in
418
419
`dotspacemacs/user-config' first."
419
420
   )
420
421
421
422
(defun dotspacemacs/user-config ()
422
423
  ;; http://spacemacs.org/doc/DOCUMENTATION.html#powerline-separators
423
424
  (setq powerline-default-separator 'slant)
424
425
  ;; Make j and k behave like gj and gk (move visual line up/down)
425
426
  (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
426
427
  (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
427
428
428
429
429
430
  (require 'ycmd)
430
431
  (setq ycmd-force-semantic-completion t)
431
432
  (add-hook 'after-init-hook #'global-ycmd-mode)
432
433
  (set-variable 'ycmd-server-command '("python" "/home/simba/.emacs.d/ycmd/ycmd"))
433
434
  (set-variable 'ycmd-server-timeout 10)
434
435
  (set-variable 'ycmd-global-config "/home/simba/.ycm_extra_conf.py")
435
436
  (require 'company)
436
437
  (set-fill-column 80)
437
438
  ;; Settings for prettify-symbols-mode
438
439
  (global-prettify-symbols-mode 1)
439
440
  (add-hook 'clojure-mode-hook
440
441
    (lambda ()
441
442
      (mapc (lambda (pair) (push pair prettify-symbols-alist))
442
443
            '(
443
444
              ("infinity" .      ?∞)))))
444
445
  (add-hook 'python-mode-hook
445
446
   (lambda ()
446
447
     (mapc (lambda (pair) (push pair prettify-symbols-alist))
447
448
           '(;; Syntax
448
449
             ;("def" .      #x2131) ;; Enable when you figure out how to make it in a pretty font...
449
450
             ("not" .      #x2757)
450
451
             ("in" .       #x2208)
451
452
             ("not in" .   #x2209)
452
453
             ("return" .   #x27fc)
453
454
             ("yield" .    #x27fb)
454
455
             ("for" .      #x2200)
455
456
             ;; Base Types
456
457
             ("int" .      #x2124)
457
458
             ("float" .    #x211d)
458
459
             ("str" .      #x1d54a)
459
460
             ("True" .     #x1d54b)
460
461
             ("False" .    #x1d53d)
461
462
             ;; Mypy
462
463
             ;;("Dict" .     #x1d507)
463
464
             ("List" .     #x2112)
464
465
             ("Tuple" .    #x2a02)
465
466
             ("Set" .      #x2126)
466
467
             ("Iterable" . #x1d50a)
467
468
             ("Any" .      #x2754)
468
469
             ("Union" .    #x22c3)))))
469
470
  (add-hook 'haskell-mode-hook
470
471
            (lambda ()
471
472
              (mapc (lambda (pair) (push pair prettify-symbols-alist))
472
473
                    '(
473
474
                      ;;Number sets & other types
474
475
                      ("Float"      . ?ℝ)
475
476
                      ("Complex"    . ?ℂ)
476
477
                      ("Int"        . ?ℤ)
477
478
                      ("Fractional" . ?ℚ)
478
479
                      ("String"     . ?𝕊)
479
480
                      ("Bool"       . ?𝔹)
480
481
                      ;; Predefined ranges
481
482
                      ("[0..]"      . ? )
482
483
                      ("[1..]"      . ? )
483
484
                      ("[(-0),(-1)..]" . ? )
484
485
                      ("[(-1),(-2)..]" . ? )
485
486
                      ;; Operators
486
487
                      ;("*" .        ?✕)
487
488
                      ("*"          . ?·) ;; Because someone asked nicely <3
488
489
                      ;;Logic
489
490
                      ("True"       . ?𝕋)
490
491
                      ("False"      . ?𝔽)))))
491
492
  ;; A lot of Haskell's signs are provided through pretty-mode already
492
493
493
494
  (add-hook 'haskell-mode-hook 'turn-on-pretty-mode)
494
495
  (require 'pretty-mode) ;; Settings for pretty-mode
495
496
  (global-pretty-mode t)
496
497
  ;; These groups will be deactivated, and pretty-mode will not use these.
497
498
  ;; However, they're more useful than using Fira Code ligatures, and
498
499
  ;; pretty-mode has support for Haskell-mode, and uses the normal font (i.e. Hack)
499
500
  ;; To display the logic and symbol. So in the future, try to activate as much
500
501
  ;; groups as possible, and deactivate manually where it's appropriate, so I can
501
502
  ;; take full advantage of GNU Emacs' offerings.
502
503
  (pretty-deactivate-groups
503
504
   '(:equality :arrows :arrows-twoheaded))
504
505
   ;;'(:equality :ordering :ordering-double :ordering-triple
505
506
               ;;:arrows :arrows-twoheaded :punctuation
506
507
               ;;:logic :sets))
507
508
508
509
  (pretty-activate-groups
509
510
   '(:sub-and-superscripts :greek :arithmetic-nary))
510
511
511
512
  ;; Prettify-utils extra code
512
513
  (require 'prettify-utils)
513
514
  (defvar pretty-options
514
515
    (-flatten
515
516
    (prettify-utils-generate
516
517
      ;; Functional
517
518
      (:lambda      "λ") (:def         "ƒ")
518
519
      (:composition "∘")
519
520
520
521
      ;; Types
521
522
      (:null        "∅") (:true        "𝕋") (:false       "𝔽")
522
523
      (:int         "ℤ") (:float       "ℝ")
523
524
      (:str         "𝕊") (:bool        "𝔹")
524
525
525
526
      ;; Flow
526
527
      (:in          "∈") (:not-in      "∉")
527
528
      (:return     "⟼") (:yield      "⟻")
528
529
      (:and         "∧") (:or          "∨")
529
530
      (:not         "¬")
530
531
      (:for         "∀")
531
532
      (:some        "∃")
532
533
533
534
      ;; Other
534
535
      (:tuple       "⨂")
535
536
      (:pipe        "")
536
537
      ))
537
538
    "Options plist for `pretty-code-get-pairs'.")
538
539
539
540
  ;;; Core
540
541
541
542
  ;;;###autoload
542
543
  (defun pretty-code-get-pairs (KWDS)
543
544
    "Build an alist for prettify-symbols-alist from components from KWDS."
544
545
    (-non-nil
545
546
    (--map (when-let (major-mode-sym (plist-get KWDS it))
546
547
            `(,major-mode-sym
547
548
              ,(plist-get pretty-options it)))
548
549
          pretty-options)))
549
550
550
551
  ;;;###autoload
551
552
  (defun pretty-code-set-pairs (HOOK-PAIRS-ALIST)
552
553
    "Add hooks setting `prettify-symbols-alist' for many modes"
553
554
    (mapc (lambda (x)
554
555
            (lexical-let ((pretty-pairs (cadr x)))
555
556
              (add-hook (car x)
556
557
                        (lambda ()
557
558
                          (setq prettify-symbols-alist pretty-pairs)))))
558
559
          HOOK-PAIRS-ALIST))
559
560
560
561
  ;; Activate superior completion mode
561
562
  (require 'company)
562
563
  (company-tng-configure-default)
563
564
  ;; Because of a bug where Helm-bookmark-map is not loaded properly, this
564
565
  ;; workaround is suggested (https://github.com/syl20bnr/spacemacs/issues/9549);
565
566
  ;; Just (require 'helm-bookmark)
566
567
  (require 'helm-bookmark)
567
568
  ;; Settings for org-mode, copied from
568
569
  ;; https://github.com/jwiegley/newartisans/blob/master/posts/2007-08-20-using-org-mode-as-a-day-planner.md
569
570
  ;;(require 'org)
570
571
571
572
  (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
572
573
573
574
  (define-key mode-specific-map [?a] 'org-agenda)
574
575
575
576
  (eval-after-load "org"
576
577
    '(progn
577
578
      (define-prefix-command 'org-todo-state-map)
578
579
579
580
      (define-key org-mode-map "\C-cx" 'org-todo-state-map)
580
581
581
582
      (define-key org-todo-state-map "x"
582
583
        #'(lambda nil (interactive) (org-todo "CANCELED")))
583
584
      (define-key org-todo-state-map "d"
584
585
        #'(lambda nil (interactive) (org-todo "DONE")))
585
586
      (define-key org-todo-state-map "f"
586
587
        #'(lambda nil (interactive) (org-todo "DEFERRED")))
587
588
      (define-key org-todo-state-map "l"
588
589
        #'(lambda nil (interactive) (org-todo "DELEGATED")))
589
590
      (define-key org-todo-state-map "s"
590
591
        #'(lambda nil (interactive) (org-todo "STARTED")))
591
592
      (define-key org-todo-state-map "w"
592
593
        #'(lambda nil (interactive) (org-todo "WAITING")))
593
594
594
595
      ;;(define-key org-agenda-mode-map "\C-n" 'next-line)
595
596
      ;;(define-key org-agenda-keymap "\C-n" 'next-line)
596
597
      ;;(define-key org-agenda-mode-map "\C-p" 'previous-line)
597
598
      ;;(define-key org-agenda-keymap "\C-p" 'previous-line)
598
599
      ))
599
600
600
601
  ;;(require 'org-capture)
601
602
  ;; Bugfix: See https://github.com/IvanMalison/org-projectile/issues/31 for more
602
603
  ;; information.
603
604
  ;(defalias 'org-projectile-per-repo 'org-projectile-per-project)
604
605
605
606
  (add-hook 'capture-mode-hook 'org-capture-apply-template)
606
607
607
608
  (define-key global-map [(control meta ?r)] 'capture)
608
609
609
610
  (custom-set-variables
610
611
  '(org-agenda-files (quote ("~/shared/planning/planning.org")))
611
612
  '(org-default-notes-file "~/shared/planning/notes.org")
612
613
  '(org-agenda-span 30)
613
614
  '(org-deadline-warning-days 14)
614
615
  '(org-agenda-show-all-dates t)
615
616
  '(org-agenda-skip-deadline-if-done t)
616
617
  '(org-agenda-skip-scheduled-if-done t)
617
618
  '(org-agenda-start-on-weekday nil)
618
619
  '(org-reverse-note-order t)
619
620
  '(org-fast-tag-selection-single-key (quote expert))
620
621
  '(org-agenda-custom-commands
621
622
    (quote (("d" todo "DELEGATED" nil)
622
623
      ("c" todo "DONE|DEFERRED|CANCELED" nil)
623
624
      ("w" todo "WAITING" nil)
624
625
      ("W" agenda "" ((org-agenda-ndays 21)))
625
626
      ("A" agenda ""
626
627
        ((org-agenda-skip-function
627
628
          (lambda nil
628
629
      (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]")))
629
630
        (org-agenda-ndays 1)
630
631
        (org-agenda-overriding-header "Today's Priority #A tasks: ")))
631
632
      ("u" alltodo ""
632
633
        ((org-agenda-skip-function
633
634
          (lambda nil
634
635
      (org-agenda-skip-entry-if (quote scheduled) (quote deadline)
635
636
              (quote regexp) "\n]+>")))
636
637
        (org-agenda-overriding-header "Unscheduled TODO entries: "))))))
637
638
  '(org-capture-store-without-prompt t)
638
639
  '(org-capture-templates
639
640
    (quote ((116 "* TODO %?\n  %u" "~/Repositories/private/org/planning.org" "Tasks")
640
641
      (110 "* %u %?" "~/Repositories/private/org/notes.org" "Notes"))))
641
642
  '(capture-annotation-functions (quote (org-capture-annotation)))
642
643
  '(capture-handler-functions (quote (org-capture-handler))))
643
644
644
645
  "Configuration function for user code.
645
646
This function is called at the very end of Spacemacs initialization after
646
647
layers configuration.
647
648
This is the place where most of your configurations should be done. Unless it is
648
649
explicitly specified that a variable should be set before a package is loaded,
649
650
you should place your code here."
650
651
  )
651
652
652
653
;; Do not write anything past this comment. This is where Emacs will
653
654
;; auto-generate custom variable definitions.
654
655
(custom-set-variables
655
656
 ;; custom-set-variables was added by Custom.
656
657
 ;; If you edit it by hand, you could mess it up, so be careful.
657
658
 ;; Your init file should contain only one such instance.
658
659
 ;; If there is more than one, they won't work right.
659
660
 '(capture-annotation-functions (quote (org-capture-annotation)))
660
661
 '(capture-handler-functions (quote (org-capture-handler)))
661
662
 '(evil-want-Y-yank-to-eol nil)
662
663
 '(org-agenda-custom-commands
663
664
   (quote
664
665
    (("d" todo "DELEGATED" nil)
665
666
     ("c" todo "DONE|DEFERRED|CANCELED" nil)
666
667
     ("w" todo "WAITING" nil)
667
668
     ("W" agenda ""
668
669
      ((org-agenda-ndays 21)))
669
670
     ("A" agenda ""
670
671
      ((org-agenda-skip-function
671
672
        (lambda nil
672
673
          (org-agenda-skip-entry-if
673
674
           (quote notregexp)
674
675
           "\\=.*\\[#A\\]")))
675
676
       (org-agenda-ndays 1)
676
677
       (org-agenda-overriding-header "Today's Priority #A tasks: ")))
677
678
     ("u" alltodo ""
678
679
      ((org-agenda-skip-function
679
680
        (lambda nil
680
681
          (org-agenda-skip-entry-if
681
682
           (quote scheduled)
682
683
           (quote deadline)
683
684
           (quote regexp)
684
685
           "
685
686
]+>")))
686
687
       (org-agenda-overriding-header "Unscheduled TODO entries: "))))))
687
688
 '(org-agenda-files (quote ("~/Repositories/private/org/planning.org")))
688
689
 '(org-agenda-show-all-dates t)
689
690
 '(org-agenda-skip-deadline-if-done t)
690
691
 '(org-agenda-skip-scheduled-if-done t)
691
692
 '(org-agenda-span 30)
692
693
 '(org-agenda-start-on-weekday nil)
693
694
 '(org-capture-store-without-prompt t)
694
695
 '(org-capture-templates
695
696
   (quote
696
697
    ((116 "* TODO %?
697
698
  %u" "~/Repositories/private/org/planning.org" "Tasks")
698
699
     (110 "* %u %?" "~/Repositories/private/org/notes.org" "Notes"))))
699
700
 '(org-deadline-warning-days 14)
700
701
 '(org-default-notes-file "~/Repositories/private/org/notes.org")
701
702
 '(org-fast-tag-selection-single-key (quote expert))
702
703
 '(org-reverse-note-order t)
703
704
 '(package-selected-packages
704
705
   (quote
705
706
    (mu4e-alert mu4e-maildirs-extension ht po-mode dash-functional iedit smartparens goto-chg projectile dash s company-ycmd company-flx emacs-ycmd evil helm helm-core avy org-plus-contrib async hydra company-mode flycheck-ycmd ycmd request-deferred let-alist deferred yaml-mode packed org-category-capture alert log4e gntp markdown-mode haml-mode gitignore-mode fringe-helper git-gutter+ git-gutter pos-tip flycheck magit magit-popup git-commit with-editor autothemer web-completion-data ghc haskell-mode company inflections edn multiple-cursors paredit peg cider queue clojure-mode yasnippet anaconda-mode pythonic auto-complete exec-path-from-shell zonokai-theme zenburn-theme zen-and-art-theme yapfify ws-butler winum which-key web-mode volatile-highlights vi-tilde-fringe uuidgen use-package underwater-theme ujelly-theme twilight-theme twilight-bright-theme twilight-anti-bright-theme tronesque-theme toxi-theme toc-org tao-theme tangotango-theme tango-plus-theme tango-2-theme tagedit sunny-day-theme sublime-themes subatomic256-theme subatomic-theme spaceline spacegray-theme soothe-theme solarized-theme soft-stone-theme soft-morning-theme soft-charcoal-theme smyx-theme smeargle slim-mode seti-theme scss-mode sass-mode reverse-theme restart-emacs rainbow-delimiters railscasts-theme pyvenv pytest pyenv-mode py-isort purple-haze-theme pug-mode professional-theme pretty-mode prettify-utils popwin planet-theme pip-requirements phoenix-dark-pink-theme phoenix-dark-mono-theme persp-mode pcre2el pastels-on-dark-theme paradox orgit organic-green-theme org-projectile org-present org-pomodoro org-download org-bullets open-junk-file omtose-phellack-theme oldlace-theme occidental-theme obsidian-theme noctilux-theme niflheim-theme neotree naquadah-theme mustang-theme move-text monokai-theme monochrome-theme molokai-theme moe-theme mmm-mode minimal-theme material-theme markdown-toc majapahit-theme magit-gitflow madhat2r-theme macrostep lush-theme lorem-ipsum live-py-mode linum-relative link-hint light-soap-theme less-css-mode jbeans-theme jazz-theme ir-black-theme intero inkpot-theme info+ indent-guide hy-mode hungry-delete htmlize hlint-refactor hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation hide-comnt heroku-theme hemisu-theme help-fns+ helm-themes helm-swoop helm-pydoc helm-projectile helm-mode-manager helm-make helm-hoogle helm-gitignore helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag hc-zenburn-theme haskell-snippets gruvbox-theme gruber-darker-theme graphviz-dot-mode grandshell-theme gotham-theme google-translate golden-ratio gnuplot gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe git-gutter-fringe+ gh-md gandalf-theme fuzzy flycheck-pos-tip flycheck-haskell flx-ido flatui-theme flatland-theme firebelly-theme fill-column-indicator farmhouse-theme fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-indent-plus evil-iedit-state evil-exchange evil-escape evil-ediff evil-args evil-anzu espresso-theme emmet-mode elisp-slime-nav dumb-jump dracula-theme django-theme diff-hl define-word darktooth-theme darkokai-theme darkmine-theme darkburn-theme dakrone-theme cython-mode cyberpunk-theme csv-mode company-web company-statistics company-ghci company-ghc company-cabal company-anaconda column-enforce-mode color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized cmm-mode clues-theme clojure-snippets clj-refactor clean-aindent-mode cider-eval-sexp-fu cherry-blossom-theme busybee-theme bubbleberry-theme birds-of-paradise-plus-theme badwolf-theme auto-yasnippet auto-highlight-symbol auto-compile apropospriate-theme anti-zenburn-theme ample-zen-theme ample-theme alect-themes aggressive-indent afternoon-theme adaptive-wrap ace-window ace-link ace-jump-helm-line ac-ispell))))
706
707
(custom-set-faces
707
708
 ;; custom-set-faces was added by Custom.
708
709
 ;; If you edit it by hand, you could mess it up, so be careful.
709
710
 ;; Your init file should contain only one such instance.
710
711
 ;; If there is more than one, they won't work right.
711
712
 '(default ((t (:background nil)))))