rc

Update to init.el

I commented (package-selected-packages) from loading; it was mentioned twice in the init.el and commenting them didn't seem to do jack shit. So I'll probably remove it definitely in the future.

Author
Maarten Vangeneugden
Date
May 25, 2022, 1:47 p.m.
Hash
ae996fda85e792da29e9316c2b15d0a0851a7806
Parent
c42369f496806c0d2bcfeac1fc852fa67b6babd0
Modified file
init.el

init.el

8 additions and 5 deletions.

View changes Hide changes
1
1
;; Copyright © 2018 Maarten Vangeneugden
2
2
;; Author: Maarten Vangeneugden <contact_me@maartenv.be>
3
3
;; URL: https://maartenv.be
4
4
;;
5
5
;; Welcome to Ghent Emacs.
6
6
;;
7
7
;; This is the configuration file for Ghent Emacs, a GNU Emacs derivative
8
8
;; developed in the city of Ghent, Belgium, by a student of Engineering
9
9
;; Informatics at Ghent University.
10
10
;;
11
11
;; License: GPLv3+
12
12
13
13
;; USAGE:
14
14
;; This configuration file uses the use-package declaration, that means the
15
15
;; settings are a bit different from what you'd normally do in a GNU Emacs
16
16
;; init.el file. Consult https://github.com/jwiegley/use-package for info on how
17
17
;; to correctly write package configuration.
18
18
19
19
(eval-when-compile
20
20
  (require 'use-package))
21
21
;(require 'diminish)                ;; if you use :diminish
22
22
(require 'bind-key)                ;; if you use any :bind variant
23
23
24
24
(custom-set-variables
25
25
 ;; custom-set-variables was added by Custom.
26
26
 ;; If you edit it by hand, you could mess it up, so be careful.
27
27
 ;; Your init file should contain only one such instance.
28
28
 ;; If there is more than one, they won't work right.
29
29
 '(custom-safe-themes
30
30
   '("78e6be576f4a526d212d5f9a8798e5706990216e9be10174e3f3b015b8662e27" "d9646b131c4aa37f01f909fbdd5a9099389518eb68f25277ed19ba99adeb7279" "8b58ef2d23b6d164988a607ee153fd2fa35ee33efc394281b1028c2797ddeebb" "f9aede508e587fe21bcfc0a85e1ec7d27312d9587e686a6f5afdbb0d220eab50" "83ae405e25a0a81f2840bfe5daf481f74df0ddb687f317b5e005aa61261126e9" "c433c87bd4b64b8ba9890e8ed64597ea0f8eb0396f4c9a9e01bd20a04d15d358" "a24c5b3c12d147da6cef80938dca1223b7c7f70f2f382b26308eba014dc4833a" "732b807b0543855541743429c9979ebfb363e27ec91e82f463c91e68c772f6e3" "a2cde79e4cc8dc9a03e7d9a42fabf8928720d420034b66aecc5b665bbf05d4e9" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "bd7b7c5df1174796deefce5debc2d976b264585d51852c962362be83932873d9" default))
31
31
 '(inhibit-startup-screen t)
+
32
 ;; Emacs stuff. This isn't necessary so setting inhibit-startup-screen to t
+
33
 ;; blocks that from happening
+
34
 '(inhibit-startup-screen t)
32
35
 '(package-selected-packages
33
-
   '(clojure-mode company-ycmd pretty-mode smooth-scrolling company-flx rainbow-delimiters dante helm pretty-fonts company spaceline company-anaconda cider evil srefactor clang-format ycmd web-mode anaconda-mode use-package powerline monokai-theme general dashboard auto-package-update))
34
-
 '(powerline-default-separator 'slant nil nil "Customized with use-package spaceline")
+
36
   ;'(clojure-mode company-ycmd pretty-mode smooth-scrolling company-flx rainbow-delimiters dante helm pretty-fonts company spaceline company-anaconda cider evil srefactor clang-format ycmd web-mode anaconda-mode use-package powerline monokai-theme general dashboard auto-package-update))
+
37
 '(powerline-default-separator 'slant nil nil "Customized with use-package spaceline")
35
38
 '(spaceline-inflation 1 t nil "Customized with use-package spaceline")
36
39
 '(spaceline-toggle-buffer-size-off nil t nil "Customized with use-package spaceline"))
37
40
;(custom-set-faces
38
41
 ;; custom-set-faces was added by Custom.
39
42
 ;; If you edit it by hand, you could mess it up, so be careful.
40
43
 ;; Your init file should contain only one such instance.
41
44
 ;; If there is more than one, they won't work right.
42
45
 ;'(default ((((class color) (min-colors 89)) (:foreground "#ffffff" :background "#263238")))))
43
46
 '(package-selected-packages
44
-
   (quote
45
-
	(powerline rainbow-mode web-mode markdown-mode restart-emacs auctex clang-format evil auto-package-update rust-mode flycheck-rust company-anaconda anaconda-mode auctex-latexmk company-auctex tide general srefactor helm-gtags-mode helm-gtags ycmd org-ref org-bullets helm-projectile git-timemachine helm-tramp help-projectile fcitx which-key use-package monokai-theme rainbow-delimiters neotree helm flycheck evil-magit dashboard company ace-popup-menu)))
46
-
+
47
   ;(quote
+
48
	;(powerline rainbow-mode web-mode markdown-mode restart-emacs auctex clang-format evil auto-package-update rust-mode flycheck-rust company-anaconda anaconda-mode auctex-latexmk company-auctex tide general srefactor helm-gtags-mode helm-gtags ycmd org-ref org-bullets helm-projectile git-timemachine helm-tramp help-projectile fcitx which-key use-package monokai-theme rainbow-delimiters neotree helm flycheck evil-magit dashboard company ace-popup-menu)))
+
49
47
50
;; To get rid of those FUCKING ANNOYING BACKUP FILES FUCKING HELL DUDE
48
51
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
49
52
  backup-by-copying t    ; Don't delink hardlinks
50
53
  version-control t      ; Use version numbers on backups
51
54
  delete-old-versions t  ; Automatically delete excess backups
52
55
  kept-new-versions 20   ; how many of the newest versions to keep
53
56
  kept-old-versions 5    ; and how many of the old
54
57
  )
55
58
;; And yes I copied it from SO, suck it: https://stackoverflow.com/questions/2680389/how-to-remove-all-files-ending-with-made-by-emacs
56
59
57
60
;; Disables the use of tabs, replaces them with spaces
58
61
(setq-default indent-tabs-mode nil)
59
62
60
63
;; Activate UTF-8 throughout Ghent Emacs
61
64
(prefer-coding-system 'utf-8)
62
65
(set-default-coding-systems 'utf-8)
63
66
(set-terminal-coding-system 'utf-8)
64
67
(set-keyboard-coding-system 'utf-8)
65
68
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
66
69
67
70
;; Line numbering config
68
71
(global-display-line-numbers-mode)
69
72
(setq display-line-numbers-mode t)
70
73
(setq display-line-numbers-widen t)
71
74
(setq display-line-numbers-type 'relative)
72
75
(setq display-line-numbers-current-absolute t)
73
76
74
77
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
75
78
(setq scroll-step 1)
76
79
(setq scroll-margin 10) ;; Keeps 10 lines above and down always visible if still left
77
80
78
81
;; Enable line breaks in all modes at column 80
79
82
(setq-default auto-fill-function 'do-auto-fill)
80
83
(setq-default fill-column 80)
81
84
82
85
(setq ring-bell-function 'ignore) ;; Disables the FUCKING ANNOYING BEEPS HOLY SHIT
83
86
84
87
;; Setup packages
85
88
;(package-initialize)
86
89
(require 'package)
87
90
(setq package-enable-at-startup nil)
88
91
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/"))
89
92
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
90
93
(unless (package-installed-p 'use-package)
91
94
  (package-refresh-contents)
92
95
(package-install 'use-package))
93
96
94
97
(setq use-package-always-ensure t)
95
98
96
99
97
100
98
101
99
102
;; Next two lines allow foregoing :ensure t on all packages
100
103
;; :ensure t simply makes sure that, if a package isn't installed on this
101
104
;; machine, it's automatically fetched and installed.
102
105
;; This doesn't keep packages up-to-date, cfr. auto-package-update for that
103
106
(require 'use-package-ensure)
104
107
(setq use-package-always-ensure t)
105
108
106
109
;; Package for automatic updating of all the other packages
107
110
(use-package auto-package-update
108
111
  :config
109
112
  (setq auto-package-update-delete-old-versions t)
110
113
  (setq auto-package-update-hide-results t)
111
114
  (auto-package-update-maybe))
112
115
113
116
;; Easier keybindings so we can do more lazy loading
114
117
(use-package general
115
118
  :ensure t
116
119
  :config
117
120
  (general-create-definer my-leader-def
118
121
	;; :prefix my-leader
119
122
	:prefix "SPC")
120
123
  (general-create-definer local-leader-def
121
124
	;; :prefix local-leader
122
125
	:prefix ","))
123
126
124
127
(use-package dashboard
125
128
  :init
126
129
  (setq dashboard-banner-logo-title "") ; It's nicer to just not have a title text.
127
130
  (setq dashboard-startup-banner "~/ghent-emacs.png")
128
131
  :config
129
132
  (dashboard-setup-startup-hook))
130
133
131
134
;; AUCTeX configuration
132
135
;; Partly inspired by https://piotr.is/2010/emacs-as-the-ultimate-latex-editor/
133
136
;;;;(use-package auctex
134
137
  ;;:init
135
138
  ;;(setq TeX-auto-save t)
136
139
  ;;(setq TeX-parse-self t)
137
140
  ;;(setq Tex-save-query nil)
138
141
  ;;)
139
142
140
143
;; Updates all packages automatically
141
144
(use-package auto-package-update
142
145
  :config
143
146
  (setq auto-package-update-delete-old-versions t)
144
147
  (setq auto-package-update-hide-results t)
145
148
  (auto-package-update-maybe))
146
149
147
150
;; UI settings
148
151
(tool-bar-mode -1)
149
152
(menu-bar-mode -1)
150
153
(toggle-scroll-bar -1)
151
154
152
155
;; Tabs and width
153
156
(setq-default tab-width 4)
154
157
(setq-default c-basic-offset 4)
155
158
156
159
(use-package spaceline
157
160
    :init
158
161
    (setq frame-char-height 35)
159
162
    (setq powerline-height 35)
160
163
    :custom
161
164
     (spaceline-toggle-buffer-size-off)
162
165
     ;(setq powerline-height 21)
163
166
  (spaceline-inflation 1)
164
167
  (powerline-default-separator 'slant)
165
168
  :config
166
169
  (spaceline-spacemacs-theme)
167
170
  (setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)) 
168
171
169
172
170
173
(use-package monokai-theme
171
174
    :init
172
175
    (load-theme 'monokai)
173
176
    :config
174
177
    (setq monokai-variable-pitch-mode t))
175
178
;; When using solarized as theme, put in :config
176
179
;; (setq x-underline-at-descent-line t)
177
180
;; Which will block an ugly line being drawn trhough the modeline.
178
181
179
182
;(add-hook 'org-mode-hook '(lambda () (setq fill-column 80)))
180
183
;(add-hook 'org-mode-hook 'auto-fill-mode)
181
184
;; (Programming) languages
182
185
183
186
184
187
185
188
(use-package dante
186
189
  :ensure t
187
190
  :after haskell-mode
188
191
  :commands 'dante-mode
189
192
  :init
190
193
  (add-hook 'haskell-mode-hook 'dante-mode)
191
194
  (add-hook 'haskell-mode-hook 'flycheck-mode))
192
195
193
196
(use-package clojure-mode
194
197
  :ensure t
195
198
  )
196
199
;(use-package anaconda-mode
197
200
  ;:ensure t
198
201
  ;:hook python-mode
199
202
  ;:config
200
203
  ;(use-package company-anaconda
201
204
    ;:ensure t
202
205
    ;:config
203
206
    ;(eval-after-load "company"
204
207
      ;'(add-to-list 'company-backends 'company-anaconda))))
205
208
  
206
209
    
207
210
;; HTML/CSS/Django
208
211
(use-package web-mode
209
212
  :ensure t
210
213
  :mode "\\.html?\\.djhtml\\'"
211
214
  :init
212
215
  (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
213
216
  (setq web-mode-markup-indent-offset 4)
214
217
  (setq web-mode-css-indent-offset 4)
215
218
  (setq web-mode-code-indent-offset 4)
216
219
  ;(setq web-mode-engines-alist
217
220
;	'(("django"    . "\\.html\\"))) ;; FIXME this doesn't work yet. IDK why.
218
221
  :custom ;; Next lines disable all the automatic completion stuff that I didn't explicitely ask for
219
222
  (web-mode-enable-auto-pairing nil)
220
223
  (web-mode-enable-auto-closing nil)
221
224
  (web-mode-enable-auto-expanding nil)
222
225
  (web-mode-enable-auto-opening nil)
223
226
  (web-mode-enable-auto-quoting nil))
224
227
225
228
(use-package ycmd-mode
226
229
  :ensure ycmd
227
230
  ;:hook (after-init . global-ycmd-mode)
228
231
  :hook (haskell-mode elisp-mode python-mode c-mode c++-mode) ; Add the modes of the languages where YCM
229
232
                                      ; needs to kick in
230
233
  :init
231
234
  ; Old paths
232
235
  ;(set-variable 'ycmd-server-command `("/usr/bin/python" ,(file-truename "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/")))
233
236
  ;(set-variable 'ycmd-global-config "/home/simba/.emacs.d/lang/ycm_conf.py")
234
237
  (set-variable 'ycmd-server-command `("python" ,(file-truename "~/ycmd/ycmd")))
235
238
  (set-variable 'ycmd-global-config (file-truename "~/Repositories/rc/.ycm_extra_conf.py"))
236
239
  (set-variable 'ycmd-global-modes 'all) ; Activates YCMD in 'all' major modes,
237
240
                                        ; not only those in ycmd-file-type-map
238
241
  ;(set-variable 'ycmd-extra-conf-whitelist '("/home/jorrit/Dev/*"))
239
242
  :config
240
243
  (setq url-show-status nil)  ; Makes those FUCKING annoying messages SHUT THE HELL UP
241
244
  (setq request-message-level -1)
242
245
  
243
246
  (use-package flycheck-ycmd
244
247
	:ensure t
245
248
	:commands (flycheck-ycmd-setup)
246
249
	:hook (ycmd-mode . flycheck-ycmd-setup)
247
250
	:init
248
251
	(setq flycheck-clang-language-standard "c++11")
249
252
	(when (not (display-graphic-p))
250
253
      (setq flycheck-indication-mode nil))))
251
254
252
255
(use-package company
253
256
 :hook (after-init . global-company-mode)
254
257
 :init
255
258
 (company-tng-configure-default)  ; Use <TAB> to scroll in completion options
256
259
 (setq company-minimum-prefix-length 2)
257
260
 (setq company-idle-delay 0.0)
258
261
 :config
259
262
 (use-package company-ycmd-mode
260
263
	:ensure company-ycmd
261
264
	:commands (company-ycmd-setup)
262
265
	:hook (ycmd-mode . company-ycmd-setup))
263
266
 (use-package company-flx
264
267
              :ensure t
265
268
              :config
266
269
              (company-flx-mode +1)))
267
270
268
271
(use-package clang-format
269
272
  :ensure t
270
273
  :general
271
274
  (local-leader-def
272
275
   :states 'normal
273
276
   :modes '(c-mode-map c++-mode-map)
274
277
   "b" '(:ignore t :which-key "clang")
275
278
   "bf" 'clang-format-buffer)
276
279
  :init
277
280
  (setq-default clang-format-style "{BasedOnStyle: llvm, IndentWidth: 4}"))
278
281
279
282
(use-package srefactor
280
283
  :ensure t
281
284
  :commands (srefactor-refactor-at-point)
282
285
  :hook ((c-mode c++-mode) . semantic-mode)
283
286
  :general
284
287
  (local-leader-def
285
288
   :states 'normal
286
289
   :keymaps '(c++-mode-map c-mode-map)
287
290
   "r" 'srefactor-refactor-at-point))
288
291
289
292
;; eViL-mode
290
293
(use-package evil
291
294
  :hook (after-init . evil-mode)
292
295
  :bind (:map evil-normal-state-map ;; Scrolls over lines correctly
293
296
              ("j" . evil-next-visual-line)
294
297
              ("k" . evil-previous-visual-line))
295
298
  :general
296
299
  (my-leader-def
297
300
	:states 'normal
298
301
    "b" '(:ignore t :which-key "buffer")
299
302
    "g" '(:ignore t :which-key "magit")
300
303
    "f" '(:ignore t :which-key "files")
301
304
	"bk" 'kill-this-buffer
302
305
	"bd" 'kill-other-buffers
303
306
	"bh" 'switch-to-home-buffer
304
307
	"br" 'revert-buffer
305
308
	"h" 'split-window-vertically
306
309
	"v" 'split-window-horizontally)
307
310
  (local-leader-def
308
311
	:states 'normal
309
312
    ;; General lang options
310
313
	"c" 'compile)
311
314
  :init
312
315
  (setq evil-find-skip-newlines t) ;; Allows f/F/t/T to search beyond CR/LF
313
316
  (setq evil-set-undo-system 'undo-tree) ;; Sets EViL up to use undo (after a
314
317
  ;; weird 2020 patch)
315
318
  (setq evil-want-C-u-scroll t)) ;; Activates c-u scroll to above.
316
319
317
320
;; About smooth-scrolling: I'd normally just use some variables for scrolling
318
321
;; but they all fail with org-mode. This package fixes everything that's wrong for me.
319
322
(use-package smooth-scrolling
320
323
   :config
321
324
   (smooth-scrolling-mode 1))
322
325
323
326
(use-package org
324
327
  :ensure t
325
328
  :pin "org"
326
329
  ; FIXME This causes some errors with bind-keys or what have you. Commented
327
330
  ; until it is fixed.
328
331
  ;:bind (:bind-keymap
329
332
  ;        ("C-c x" . org-todo-state-map)
330
333
  ;       :map org-todo-state-map
331
334
  ;        ("x" . #'(lambda nil (interactive) (org-todo "CANCELLED")))
332
335
  ;        ("d" . #'(lambda nil (interactive) (org-todo "DONE")))
333
336
  ;        ("f" . #'(lambda nil (interactive) (org-todo "DEFERRED")))
334
337
  ;        ("l" . #'(lambda nil (interactive) (org-todo "DELEGATED")))
335
338
  ;        ("s" . #'(lambda nil (interactive) (org-todo "STARTED")))
336
339
  ;        ("w" . #'(lambda nil (interactive) (org-todo "WAITING"))))
337
340
;         :map org-mode-map
338
341
;          ("C-c x" . org-todo-state-map))
339
342
   :init
340
343
  (define-key mode-specific-map [?a] 'org-agenda)
341
344
  :custom
342
345
  ;; Because I use XeLaTeX (it's objectively better), some variables need to be
343
346
  ;; set so org-mode knows what to call.
344
347
345
348
  ;; Okay, so you cán export asynchronous so compiling your PDF doesn't lock up
346
349
  ;; the editor completely, but for one reason or another, you MUST set the
347
350
  ;; async-debug to nil. Otherwise it will constantly "exit abnormally" without
348
351
  ;; reason. This fixes it, who knows why.
349
352
  (org-export-async-debug nil)
350
353
  
351
354
  (org-latex-compiler 'xelatex)  ; Makes sure the XeLaTeX compiler is used
352
355
  
353
356
  ; Tells Org to use dvisvgm because dvipng does not support XeLaTeX's output format
354
357
  (org-preview-latex-default-process 'dvisvgm)
355
358
  
356
359
  ; This edits the preview process so it works correctly with XeLaTeX.
357
360
  ; Changes: 
358
361
  ; - "latex" to "xelatex" 
359
362
  ; - Added the "-no-pdf" flag so it prints an XDV file instead of PDF.
360
363
  ; - change input type from dvi to xdv
361
364
  ; - Only leave the dvisvgm option because I don't need the others
362
365
  (org-preview-latex-process-alist
363
366
   (quote
364
367
    ((dvisvgm :programs
365
368
              ("xelatex" "dvisvgm")
366
369
              :description "dvi > svg" :message "you need to install the programs: xelatex and dvisvgm." :use-xcolor t :image-input-type "xdv" :image-output-type "svg" :image-size-adjust
367
370
              (1.7 . 1.5)
368
371
              :latex-compiler
369
372
              ("xelatex -interaction nonstopmode -no-pdf -output-directory %o %f")
370
373
              :image-converter
371
374
              ("dvisvgm %f -n -b min -c %S -o %O")))))
372
375
373
376
  ;; Sets the formatting options. I only changed :scale to 1.6, but I don't know
374
377
  ;; how to change only thát, so for now I'm configuring the entire variable
375
378
  (org-format-latex-options (quote
376
379
   (:foreground default :background default :scale 1.6 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers
377
380
             ("begin" "$1" "$" "$$" "\\(" "\\["))))
378
381
    
379
382
  ;; Sets the directory in which the preview fragments are stored to the /tmp
380
383
  ;; folder. Otherwise it clutters up the folder in which the source resides
381
384
  ;; with what are essentially cache files.
382
385
  (org-preview-latex-image-directory "/tmp/ltximg/")
383
386
  
384
387
  ;; Following customizations are in regard to org-agenda configuration.
385
388
  (org-agenda-files (quote ("~/shared/planning/planning.org")))
386
389
  (org-default-notes-file "~/shared/planning/notes.org")
387
390
  (org-agenda-span 62)
388
391
  (org-deadline-warning-days 14)
389
392
  (org-agenda-show-all-dates t)
390
393
  (org-agenda-skip-deadline-if-done t)
391
394
  (org-agenda-skip-scheduled-if-done t)
392
395
  (org-agenda-start-on-weekday nil)
393
396
  (org-reverse-note-order t)
394
397
  (org-fast-tag-selection-single-key (quote expert))
395
398
  (org-agenda-custom-commands
396
399
    (quote (("d" todo "DELEGATED" nil)
397
400
      ("c" todo "DONE|DEFERRED|CANCELED" nil)
398
401
      ("w" todo "WAITING" nil)
399
402
      ("W" agenda "" ((org-agenda-ndays 21)))
400
403
      ("A" agenda ""
401
404
        ((org-agenda-skip-function
402
405
          (lambda nil
403
406
      (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]")))
404
407
        (org-agenda-ndays 1)
405
408
        (org-agenda-overriding-header "Today's Priority #A tasks: ")))
406
409
      ("u" alltodo ""
407
410
        ((org-agenda-skip-function
408
411
          (lambda nil
409
412
      (org-agenda-skip-entry-if (quote scheduled) (quote deadline)
410
413
              (quote regexp) "\n]+>")))
411
414
        (org-agenda-overriding-header "Unscheduled TODO entries: "))))))
412
415
  (org-capture-store-without-prompt t)
413
416
  (org-capture-templates
414
417
    (quote ((116 "* TODO %?\n  %u" "~/Repositories/private/org/planning.org" "Tasks")
415
418
      (110 "* %u %?" "~/Repositories/private/org/notes.org" "Notes"))))
416
419
  (capture-annotation-functions (quote (org-capture-annotation)))
417
420
  (capture-handler-functions (quote (org-capture-handler))))
418
421
419
422
  ;:general
420
423
  ;(local-leader-def
421
424
  ;  :states 'normal
422
425
  ;  :keymaps 'org-mode-map
423
426
;	"e" 'org-export-dispatch
424
427
;	"x" 'org-table-export
425
428
;	"." 'org-time-stamp
426
429
;	"t" 'org-twbs-export-to-html
427
430
;	"s" 'org-schedule
428
431
;	"d" 'org-deadline
429
432
;	"'" 'org-edit-special)
430
433
;  :config
431
434
;  ;; log todo items with timestamp
432
435
;  (setq org-log-done 'time))
433
436
434
437
;; XXX: I've opted not to use Cider for now because Clojure-mode and Company
435
438
;; already give enough completion and fast enough that I don't really feel like
436
439
;; I need this for now. I'll add it later when it's more useful.
437
440
(use-package cider
438
441
  :ensure t)
439
442
;  :ensure t
440
443
;  :hook clojure-mode)
441
444
  ;:mode "\\.clj\\'")
442
445
;; TODO See what can be deleted from helm config while still having all the
443
446
;; wanted functionality
444
447
(use-package helm
445
448
  :ensure t
446
449
  :hook (after-init . helm-mode)
447
450
  :commands (helm-autoresize-mode)
448
451
  :init
449
452
  ;; (defvar helm-google-suggest-use-curl-p)
450
453
  (defvar helm-ff-search-library-in-sexp)
451
454
  (defvar helm-echo-input-in-header-line)
452
455
  (defvar helm-ff-file-name-history-use-recentf)
453
456
  :general
454
457
  (general-define-key
455
458
   "M-x" 'helm-M-x
456
459
   "M-:" 'helm-eval-expression
457
460
   "C-c h" 'helm-command-prefix)
458
461
  (general-define-key
459
462
   :keymaps 'helm-map
460
463
   "<tab>" 'helm-execute-persistent-action
461
464
   "C-i" 'helm-execute-persistent-action
462
465
   "C-z" 'helm-select-action)
463
466
  (my-leader-def
464
467
	:states 'normal
465
468
	"bb" 'helm-buffers-list
466
469
	"ff" 'helm-find-files
467
470
	"p" 'helm-show-kill-ring)
468
471
  :config
469
472
  (setq helm-split-window-inside-p           t ; open helm buffer inside current window, not occupy whole other window
470
473
	helm-move-to-line-cycle-in-source     t ; move to end or beginning of source when reaching top or bottom of source.
471
474
	helm-ff-search-library-in-sexp        t ; search for library in `require' and `declare-function' sexp.
472
475
	helm-scroll-amount                    8 ; scroll 8 lines other window using m-<next>/m-<prior>
473
476
	helm-ff-file-name-history-use-recentf t
474
477
	helm-echo-input-in-header-line t)
475
478
476
479
  ;; hide some autogenerated files from helm
477
480
  (setq helm-ff-skip-boring-files t)
478
481
  ;; (add-to-list 'helm-boring-file-regexp-list "\\~$")
479
482
  
480
483
  (setq helm-autoresize-max-height 0)
481
484
  (setq helm-autoresize-min-height 20)
482
485
  (helm-autoresize-mode 1))
483
486
484
487
485
488
(use-package rainbow-delimiters
486
489
  :hook (prog-mode . rainbow-delimiters-mode))
487
490
488
491
;; Font settings, ligatures and symbol config
489
492
(set-frame-font "Hack 13" nil t)
490
493
491
494
(use-package pretty-mode
492
495
    :ensure t
493
496
    :init
494
497
    (global-pretty-mode t)
495
498
    (pretty-deactivate-groups
496
499
     '(:equality :ordering :ordering-double :ordering-triple
497
500
                 :arrows :arrows-twoheaded :punctuation
498
501
                 :logic :sets))
499
502
    (pretty-activate-groups
500
503
     '(:sub-and-superscripts :greek :arithmetic-nary)))
501
504
(global-prettify-symbols-mode 1)
502
505
(add-hook
503
506
 'python-mode-hook
504
507
 (lambda ()
505
508
   (mapc (lambda (pair) (push pair prettify-symbols-alist))
506
509
         '(;; Syntax
507
510
           ("def" .      #x2131)
508
511
           ("not" .      #x2757)
509
512
           ("in" .       #x2208)
510
513
           ("not in" .   #x2209)
511
514
           ("return" .   #x27fc)
512
515
           ("yield" .    #x27fb)
513
516
           ("for" .      #x2200)
514
517
           ;; Base Types
515
518
           ("int" .      #x2124)
516
519
           ("float" .    #x211d)
517
520
           ("str" .      #x1d54a)
518
521
           ("True" .     #x1d54b)
519
522
           ("False" .    #x1d53d)
520
523
           ;; Mypy
521
524
           ("Dict" .     #x1d507)
522
525
           ("List" .     #x2112)
523
526
           ("Tuple" .    #x2a02)
524
527
           ("Set" .      #x2126)
525
528
           ("Iterable" . #x1d50a)
526
529
           ("Any" .      #x2754)
527
530
           ("Union" .    #x22c3)))))
528
531
529
532
;; Settings for having an LaTeX beamer class export tool
530
533
(unless (boundp 'org-export-latex-classes)
531
534
(setq org-export-latex-classes nil))
532
535
(add-to-list 'org-export-latex-classes
533
536
;; beamer class, for presentations
534
537
'("beamer"
535
538
    "\\documentclass[11pt]{beamer}\n
536
539
    \\mode<{{{beamermode}}}>\n
537
540
    \\usetheme{{{{beamertheme}}}}\n
538
541
    \\usecolortheme{{{{beamercolortheme}}}}\n
539
542
    \\beamertemplateballitem\n
540
543
    \\setbeameroption{show notes}
541
544
    \\usepackage[utf8]{inputenc}\n
542
545
    \\usepackage[T1]{fontenc}\n
543
546
    \\usepackage{hyperref}\n
544
547
    \\usepackage{color}
545
548
    \\usepackage{listings}
546
549
    \\lstset{numbers=none,language=[ISO]C++,tabsize=4,
547
550
frame=single,
548
551
basicstyle=\\small,
549
552
showspaces=false,showstringspaces=false,
550
553
showtabs=false,
551
554
keywordstyle=\\color{blue}\\bfseries,
552
555
commentstyle=\\color{red},
553
556
}\n
554
557
    \\usepackage{verbatim}\n
555
558
    \\institute{{{{beamerinstitute}}}}\n          
556
559
    \\subject{{{{beamersubject}}}}\n"
557
560
558
561
    ("\\section{%s}" . "\\section*{%s}")
559
562
560
563
    ("\\begin{frame}[fragile]\\frametitle{%s}"
561
564
    "\\end{frame}"
562
565
    "\\begin{frame}[fragile]\\frametitle{%s}"
563
566
    "\\end{frame}")))
564
567
565
568
;; Adds a letter class, for formal letters
566
569
567
570
(add-to-list 'org-export-latex-classes
568
571
569
572
'("letter"
570
573
    "\\documentclass[11pt]{letter}\n
571
574
    \\usepackage[utf8]{inputenc}\n
572
575
    \\usepackage[T1]{fontenc}\n
573
576
    \\usepackage{color}"
574
577
575
578
    ("\\section{%s}" . "\\section*{%s}")
576
579
    ("\\subsection{%s}" . "\\subsection*{%s}")
577
580
    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
578
581
    ("\\paragraph{%s}" . "\\paragraph*{%s}")
579
582
    ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
580
583
581
584
582
585
;(require 'ycmd)
583
586
;(add-hook 'after-init-hook #'global-ycmd-mode)
584
587
(custom-set-faces
585
588
 ;; custom-set-faces was added by Custom.
586
589
 ;; If you edit it by hand, you could mess it up, so be careful.
587
590
 ;; Your init file should contain only one such instance.
588
591
 ;; If there is more than one, they won't work right.
589
592
 )
590
593