rc

Add GNU Emacs init.el file for tracking

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

init.el

590 additions and 0 deletions.

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