rc

Update company-mode

I found a new company-frontend called company-fuzzy. And while it's more than 90% of what I long for since YouCompleteMe, it's also an improvement over that in a lot of ways: - I don't need a seperate YouCompleteMe daemon being spun up constantly, which was already buggy and prone to crash anyway - It's completely written in Emacs Lisp so everything is well contained, no external software programs required - It hooks practically seamlessly with my other modes; I just tested it quickly on Emacs Lisp and Python files, and in both of them, I got fast and correct results while giving a fuzzy match; it didn't care for underscores or dashes, which is exactly how I like it.

Author
Maarten Vangeneugden
Date
May 25, 2022, 2:16 p.m.
Hash
1f636fae8039c45c6b90451407fe2afb9a34fe38
Parent
1aab7f75162b4eb3c39274ceb4334a549bd2e4a0
Modified file
init.el

init.el

50 additions and 48 deletions.

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