-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
727 lines (656 loc) · 23.7 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
;;; init.el --- Trev's Emacs Config -*- lexical-binding: t -*-
;;;
;;; Commentary:
;;; A minimalistic development environment
;;;
;;; Code:
(use-package package
:config
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t))
(use-package use-package
:preface
(defun trev/use-package-ensure (name args _state &optional _no-refresh)
"Checks for local package before checking remote archives."
(if-let* ((not-feature (not (featurep name)))
(path (locate-library (symbol-name name)))
(_ (not (package-installed-p name))))
(package-install-file path)
(when not-feature (use-package-ensure-elpa name args _state _no-refresh))))
:custom
(use-package-always-defer t)
(use-package-always-ensure t)
(use-package-ensure-function #'trev/use-package-ensure)
(use-package-expand-minimally t))
(use-package emacs
:demand t
:preface
(defun display-startup-time ()
(message "Emacs loaded in %s with %d garbage collections."
(format "%.2f seconds"
(float-time
(time-subtract after-init-time before-init-time)))
gcs-done))
(defun header-line-file-path ()
"Set `header-line-format' if symbol `buffer-file-name' is not nil."
(when buffer-file-name
(setq header-line-format '("%f"))))
(defun sudo-save ()
(interactive)
(if (not buffer-file-name)
(write-file (concat "/sudo:root@localhost:" (ido-read-file-name "File:")))
(write-file (concat "/sudo:root@localhost:" buffer-file-name))))
(defun open-user-config ()
"Opens user's config file"
(interactive) (find-file user-init-file))
(defun switch-to-buffer-last ()
"Toggles back to previously visited buffer"
(interactive) (switch-to-buffer nil))
:hook
((emacs-startup . display-startup-time)
(buffer-list-update . header-line-file-path)
(prog-mode . display-line-numbers-mode))
:init
(add-to-list 'load-path (concat user-emacs-directory "/lisp"))
(save-place-mode)
(recentf-mode)
(desktop-save-mode) ; Session saving
(column-number-mode) ; Column number mode
(global-auto-revert-mode) ; Auto-refresh buffers
(electric-pair-mode) ; Pair the pairs
(auto-fill-mode) ; Autofill mode
(window-divider-mode) ; Gap between splits
(put 'suspend-frame 'disabled t) ; Disable suspend-frame
;; Fonts
(set-face-attribute 'default nil :family "Iosevka JBM" :height 150 :weight 'medium)
(set-face-attribute 'variable-pitch nil :family "Noto Sans")
;; https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
(let ((nerdfont-code-points
'((#xE6FA . #xE6B2) (#xE700 . #xE7C5) (#xF000 . #xF2E0) (#xE200 . #xE2A9)
(#xF500 . #xFD46) (#xE300 . #xE3EB) (#xF400 . #xF532) (#xE0B4 . #xE0C8)
(#xF0001 . #xF1AF0) (#xE0CC . #xE0D4) (#x23FB . #x23FE) (#xF300 . #xF372)
(#xE000 . #xE00A) (#xEA60 . #xEBEB) #x2665 #x26A1 #xF2A1 #xF27C #xE0A3 #xE0CA)))
(dolist (code-point nerdfont-code-points)
(set-fontset-font t code-point (font-spec :family "Symbols Nerd Font Mono"))))
;; Generic keybindings
:bind
(("C-x K" . 'kill-current-buffer)
("C-c b" . 'ibuffer)
("C-'" . 'switch-to-buffer-last)
("C-c !" . 'open-user-config))
;; Miscellaneous Options
:custom
(auto-fill-function 'do-auto-fill)
(auto-revert-verbose nil)
(auto-save-file-name-transforms '((".*" "~/.cache/emacs/saves/" t)))
(backup-directory-alist '(("." . "~/.cache/emacs/backups")))
(comment-auto-fill-only-comments t) ; Autofill comments only
(confirm-kill-emacs nil)
(custom-file "/tmp/custom.el") ; customization file
(desktop-load-locked-desktop 'check-pid) ; load if lock pid doesn't exist
(display-buffer-alist ; Prefer right split for matched buffers
'(("\\*\\(Help\\|helpful\\|Customize\\|info\\|xref\\).*\\*"
(display-buffer-reuse-window display-buffer-in-side-window)
(side . right)
(slot . 0)
(window-width .5))))
(display-line-numbers-grow-only t) ; Never shrink the linum width
(display-line-numbers-width-start t) ; Calculate linum width at start
(eldoc-echo-area-use-multiline-p nil)
(enable-recursive-minibuffers t) ; Recursive mini-buffers
(epg-pinentry-mode 'loopback) ; pinentry on minibuffer
(fill-column 80) ; 80 width pages
(global-auto-revert-non-file-buffers t) ; Auto-refresh buffers like dired
(indent-tabs-mode nil) ; Use spaces only
(inhibit-startup-message t) ; No startup screen
(kill-buffer-quit-windows t)
(mode-line-end-spaces nil)
(mode-line-front-space nil) ; Nicer -nw mode line
(mouse-wheel-progressive-speed nil)
(quit-restore-window-no-switch 'skip-first)
(read-extended-command-predicate #'command-completion-default-include-p)
(ring-bell-function 'ignore)
(scroll-preserve-screen-position 1) ; PgUp/PgDown hold
(send-mail-function 'message-send-mail-with-sendmail) ; Use sendmail
(tab-always-indent 'complete) ; TAB to complete
(treesit-font-lock-level 4) ; More treesitter faces
(undo-limit 67108864) ; 64mb.
(undo-outer-limit 1006632960) ; 960mb.
(undo-strong-limit 100663296) ; 96mb.
(use-default-font-for-symbols nil) ; For nerd fonts
(use-dialog-box nil) ; Bye
(use-short-answers t) ; y/n
(user-full-name "Trevor Arjeski")
(user-mail-address "[email protected]")
(window-divider-default-right-width 16)) ; Padding between splits
;; Ligatures
(use-package ligature
:hook (prog-mode . ligature-mode)
:config
(ligature-set-ligatures
'prog-mode
'(
"-<<" "-<" "-<-" "<--" "<---" "<<-" "<-" "->" "->>" "-->" "--->" "->-" ">-" ">>-"
"=<<" "=<" "=<=" "<==" "<===" "<<=" "<=" "=>" "=>>" "==>" "===>" "=>=" ">=" ">>="
"<->" "<-->" "<--->" "<---->" "<=>" "<==>" "<===>" "<====>" "::" ":::" "__" "--"
"<~~" "~~>" "==" "!=" "/=" "~=" "<>" "===" "!==" "!===" "=/=" "=!="
"<:" ":=" "*=" "*+" "<*" "<*>" "*>" "<." "<.>" ".>" "+*" "=*" "=:" ":>"
"(*" "*)" "++" "+++" "|-" "-|" "<!--" "<!---")))
;; Colorscheme
(use-package doom-themes
:demand
:preface
(defun get-doom-theme-color (name)
(car (alist-get name doom-themes--colors)))
:custom
(doom-themes-enable-bold t)
(doom-themes-enable-italic nil)
(doom-nord-padded-modeline t)
(doom-nord-brighter-modeline t)
:config
(load-theme 'doom-nord t)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config)
(let ((bg (get-doom-theme-color 'base2))
(bg-light (get-doom-theme-color 'base3))
(yellow (get-doom-theme-color 'yellow))
(orange (get-doom-theme-color 'orange)))
(set-face-background 'cursor orange)
(set-face-background 'highlight yellow)
(set-face-attribute 'mode-line nil
:background bg-light
:foreground (get-doom-theme-color 'base6)
:box `(:line-width (6 . 6) :color ,bg-light))
(set-face-attribute 'mode-line-active nil
:background bg-light
:box `(:line-width (6 . 6) :color ,bg-light))
(set-face-attribute 'mode-line-inactive nil
:background bg
:foreground (get-doom-theme-color 'base5)
:box `(:line-width (6 . 6) :color ,bg))
(set-face-attribute 'font-lock-function-name-face nil :weight 'bold)
(set-face-attribute 'font-lock-keyword-face nil
:foreground orange :weight 'bold)
(set-face-attribute 'window-divider nil :inherit 'ansi-color-black)))
;; Project.el
(use-package project
:bind
(:map project-prefix-map
(("t" . 'eat-project-other-window)))
:custom
(project-switch-commands
'((project-find-file "Find file" ?f)
(consult-ripgrep "Find regexp" ?g)
(magit-project-status "Magit" ?m)
(eat-project-other-window "Term" ?t)
(project-any-command "Other" ?o))))
;; Diminish minor modes
(use-package diminish
:demand
:config (diminish 'auto-revert-mode))
(use-package xref
:custom
(xref-auto-jump-to-first-definition 'show)
(xref-search-program 'ripgrep))
;; Keybinding
(use-package which-key
:init
(which-key-mode)
:bind
(("C-c K" . 'which-key-show-major-mode))
:config
(which-key-setup-side-window-bottom)
(setq which-key-sort-order 'which-key-description-order)
:diminish which-key-mode)
;; Window navigation
(use-package ace-window
:bind (("M-o" . ace-window)))
(use-package undo-fu
:init
(global-unset-key (kbd "C-z"))
:bind
(("C-z" . 'undo-fu-only-undo)
("C-S-z" . 'undo-fu-only-redo)))
(use-package undo-fu-session
:demand
:config
(undo-fu-session-global-mode))
;; Searching
(use-package isearch
:custom
(isearch-lazy-count t)
:bind
(:map isearch-mode-map
("C-n" . isearch-repeat-forward)
("C-p" . isearch-repeat-backward)))
(use-package grep
:custom
(grep-use-headings t)
(grep-command "rg -nHS0 --no-heading "))
;; Ibuffer
(use-package ibuffer
:preface
(defun ibuffer-mark-unimportant-for-delete ()
(interactive)
(ibuffer-mark-special-buffers)
(ibuffer-mark-read-only-buffers)
(ibuffer-change-marks ?> ?D))
:bind
(:map ibuffer-mode-map
("* D" . #'ibuffer-mark-unimportant-for-delete)))
(use-package autoinsert
:custom (auto-insert-query nil)
:init (auto-insert-mode))
;; Minibuffer
(use-package vertico
:custom
(vertico-count 10)
(vertico-cycle t)
(vertico-scroll-margin 5)
:init (vertico-mode))
(use-package orderless
:custom
(completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion))))
(completion-styles '(orderless basic)))
(use-package icomplete
:disabled
:init (fido-vertical-mode)
:bind
(:map icomplete-fido-mode-map
(("TAB" . 'icomplete-force-complete)))
(:map completion-list-mode-map
(("C-p" . 'minibuffer-previous-completion)
("C-n" . 'minibuffer-next-completion)))
:custom
(completion-category-overrides '((file (styles basic partial-completion))))
(completion-styles '(flex partial-completion emacs22))
(completions-max-height 10)
(icomplete-compute-delay 0.05)
(icomplete-delay-completions-threshold 2000)
:custom-face
(icomplete-selected-match ((t (:background ,(get-doom-theme-color 'base4))))))
;; Save minibuffer history between restarts
(use-package savehist
:init
(savehist-mode))
;; Minibuffer annotations
(use-package marginalia
:init (marginalia-mode))
;; Useful functions
(use-package consult
:bind (("C-c c r" . consult-register)
("C-c /" . consult-ripgrep)
("C-<return>" . consult-line)
("C-c <SPC>" . consult-fd)
("C-c c i" . consult-info)
("C-c c m" . consult-man)
("C-c r" . consult-recent-file)
("C-x b" . consult-buffer) ; orig. switch-to-buffer
("C-c c p" . consult-project-buffer) ; orig. project-switch-to-buffer
("C-c c b" . consult-bookmark) ; orig. bookmark-jump
("M-g M-g" . consult-goto-line) ; orig. goto-line
("M-g e" . consult-compile-error)
("M-g f" . consult-flymake)
("M-g k" . consult-global-mark)
("M-g m" . consult-mark)
("M-y" . consult-yank-pop) ; orig. yank-pop
([remap Info-search] . consult-info)
:map isearch-mode-map
("M-e" . consult-isearch-history) ; orig. isearch-edit-string
("M-s L" . consult-line-multi) ; needed by consult-line to detect isearch
("M-s e" . consult-isearch-history) ; orig. isearch-edit-string
("M-s l" . consult-line) ; needed by consult-line to detect isearch
;; Minibuffer history
:map minibuffer-local-map
("M-r" . consult-history)
("M-s" . consult-history)) ; orig. next-matching-history-element
:custom
(completion-ignore-case t)
(read-buffer-completion-ignore-case t)
(read-file-name-completion-ignore-case t))
(use-package helpful
:bind
(("C-h f" . #'helpful-callable)
("C-h v" . #'helpful-variable)
("C-h k" . #'helpful-key)
("C-h x" . #'helpful-command)
("C-h o" . #'helpful-symbol)
("C-c C-d" . #'helpful-at-point)))
;; Completion
(use-package corfu
:init
(global-corfu-mode)
:bind
(:map corfu-map
("RET" . nil))
:custom
(corfu-auto t)
(corfu-left-margin-width 4)
(corfu-popupinfo-delay 0)
(corfu-preview-current nil)
(corfu-quit-no-match 'separator)
(corfu-right-margin-width 4)
:config
(corfu-popupinfo-mode)
(add-to-list 'corfu--frame-parameters '(internal-border-width . 4))
(set-face-background 'corfu-border (get-doom-theme-color 'orange)))
(use-package orderless
:custom
(completion-styles '(orderless basic))
(completion-category-overrides '((file (styles basic partial-completion)))))
;; Completion-at-point helper
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-file)
:custom
(text-mode-ispell-word-completion 'cape-dict))
(use-package treesit-auto
:demand
:custom
(treesit-auto-install 'prompt)
(treesit-auto-add-to-auto-mode-alist 'all)
:config
(global-treesit-auto-mode))
;; Whitespace handling
(use-package ws-butler
:config
(ws-butler-global-mode)
:diminish)
;; Rainbow delimiters
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
;; Editorconfig
(use-package editorconfig
:config
(editorconfig-mode)
:diminish)
;; Buffer specific direnv
(use-package envrc
:diminish
:config (envrc-global-mode))
;; Avy navigation
(use-package avy
:bind
(("C-c w" . #'avy-goto-word-1)
("C-c s" . #'avy-goto-char-timer)))
(use-package ibuffer
:hook (ibuffer-mode . ibuffer-auto-mode))
;; Formatting
(use-package format-all
:commands format-all-mode
:hook
(prog-mode . format-all-mode)
(prog-mode . format-all-ensure-formatter)
:config
(setq-default format-all-formatters
'(("Shell" (shfmt "-i" "2" "-ci"))))
:diminish)
;; Colorize hex color codes
(use-package rainbow-mode)
;; Git
(use-package magit
:custom
(magit-define-global-key-bindings 'recommended)
(magit-diff-refine-hunk t)
:hook (git-commit-setup . git-commit-turn-on-flyspell))
;; Git modes
(use-package git-modes)
(use-package diff-hl
:hook
((magit-post-refresh . diff-hl-magit-post-refresh)
(magit-pre-refresh . diff-hl-magit-pre-refresh))
:config
(global-diff-hl-mode)
(diff-hl-flydiff-mode))
(use-package nerd-icons-dired
:hook
(dired-mode . nerd-icons-dired-mode))
;; Terminal
(use-package eat
:commands (eat)
:custom
(eat-kill-buffer-on-exit t)
(eat-term-scrollback-size 1200000))
;; Eglot LSP
(use-package eglot
:hook
(c-ts-mode . eglot-ensure)
(bash-ts-mode . eglot-ensure)
(sh-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure)
:bind
(:map eglot-mode-map
:prefix-map eglot-prefix-keymap
:prefix "C-c l"
("a" . eglot-code-actions)
("o" . eglot-code-actions-organize-imports)
("r" . eglot-rename)
("f" . eglot-format)
("d" . eglot-find-declaration)
("r" . eglot-find-implementation)
("t" . eglot-find-typeDefinition))
:config
;; Server customization
(setf eglot-server-programs
'(((bash-ts-mode sh-mode) . ("bash-language-server" "start"))
(rust-ts-mode . ("rust-analyzer"
:initializationOptions
(:check
(:command "clippy")
:procMacro
(:enable :json-false))))
((c-ts-mode c++-ts-mode) . ("clangd"))))
(defalias 'start-lsp-server #'eglot))
;; Paredit
(use-package paredit
:hook ((lisp-mode emacs-lisp-mode scheme-mode) . enable-paredit-mode)
:bind (:map paredit-mode-map (("M-?" . nil))))
;; Rust
(use-package rust-mode
:custom
(rust-mode-treesitter-derive t)
(rust-format-on-save t))
;; Guile
(use-package geiser-guile
:config
(add-to-list 'geiser-guile-load-path "~/Workspace/guix"))
;; Common Lisp
(use-package sly
:custom
(inferior-lisp-program (executable-find "sbcl")))
;; Markdown
(use-package markdown-mode)
;; Secrets
(use-package my-secrets
:ensure nil)
;; IRC/ERC
(use-package erc
:load my-secrets
:preface
(defun erc-connect ()
(interactive)
(erc :server erc-server
:port erc-port
:user erc-nick
:full-name erc-user-full-name))
(defun erc-clear-query-buffer ()
(when (erc-query-buffer-p)
(erc-send-input-line "*status" (format "clearbuffer %s" (erc-target)))))
(let ((hidden-fools t))
(defun erc-toggle-fools ()
(interactive)
(setq hidden-fools (not hidden-fools))
(erc-match-toggle-hidden-fools hidden-fools)
(message "hidden fools: %s" (if hidden-fools "on" "off"))
(set-buffer-modified-p t)))
(defun erc-track-external-notification ()
"Run on `erc-track-list-changed-hook' and silently writes to a named
fifo /tmp/erc-track.fifo."
(when-let* ((fifo "/tmp/erc-track.fifo")
(file-exists-p fifo))
(write-region
(format "%s\n" (or (mapcar 'buffer-name (mapcar #'car erc-modified-channels-alist)) ""))
nil fifo t 'quiet)))
:bind
(("C-c #" . 'erc-connect)
:map erc-mode-map
("C-c -" . 'erc-toggle-fools))
:custom
(erc-current-nick-highlight-type 'all)
(erc-fill-function 'erc-fill-static)
(erc-fill-static-center 16)
(erc-fool-highlight-type 'all)
(erc-hide-list '("JOIN" "NICK" "QUIT" "MODE" "AWAY" "PART" "353"))
(erc-insert-timestamp-function 'erc-insert-timestamp-left)
(erc-nick "trev")
(erc-nicks-track-faces t)
(erc-port 7777)
(erc-prompt 'erc-prompt-format)
(erc-prompt-format (propertize "%n:" 'font-lock-face 'erc-input-face))
(erc-receive-query-display 'bury)
(erc-server "orangepi")
(erc-server-reconnect-function 'erc-server-delayed-check-reconnect)
(erc-timestamp-format "%H:%M")
(erc-track-exclude '("#emacs" "#systemcrafters-live" "*status"))
(erc-track-exclude-server-buffer t)
(erc-track-exclude-types '("JOIN" "NICK" "QUIT" "MODE" "AWAY" "PART")
"353" "324" "332" "329" "333" "477")
(erc-track-faces-priority-list
'(erc-error-face erc-current-nick-face erc-keyword-face erc-pal-face
erc-nick-msg-face erc-direct-msg-face
erc-dangerous-host-face erc-nick-default-face
(erc-button-nick-default-face erc-nick-default-face)
erc-default-face erc-action-face erc-fool-face
erc-notice-face erc-input-face erc-prompt-face)
(erc-user-full-name user-full-name))
:config
(setopt erc-modules (seq-union '(nicks scrolltobottom spelling) erc-modules)
erc-nicks-colors (mapcar 'get-doom-theme-color
'(orange yellow teal blue dark-blue cyan violet)))
;; for more "themed" erc-nicks-colors
(setq erc-nicks--create-pool-function 'erc-nicks--create-culled-pool)
;; Fix for restoring query buffers with self-messages
(advice-add #'erc-login
:before (lambda ()
(erc-server-send "CAP REQ :znc.in/self-message")
(erc-server-send "CAP END")))
;; Clear out query bufs when using using `AutoClearQueryBuffer = false`
(add-to-list 'erc-kill-buffer-hook 'erc-clear-query-buffer)
(erc-spelling-mode)
(erc-scrolltobottom-mode)
(defun erc-match-directed-at-fool-p (_msg) nil)
:hook
(erc-mode . (lambda ()
(auto-fill-mode -1)
(add-to-list 'completion-at-point-functions 'cape-emoji)
(setq-local scroll-margin 0)))
(erc-text-matched . erc-hide-fools)
(erc-match-mode . (lambda ()
(set-face-attribute 'erc-current-nick-face nil
:foreground (get-doom-theme-color 'red)
:slant 'italic :weight 'heavy)))
(erc-track-list-changed . erc-track-external-notification))
(use-package elfeed
:load my-secrets
:preface
(defun elfeed-show-visit-eww ()
(interactive)
(let ((browse-url-browser-function #'eww-browse-url))
(elfeed-show-visit)))
:bind
(("C-c @" . #'elfeed)
:map elfeed-show-mode-map
("e" . 'elfeed-show-visit-eww)))
;; GNU Bug tracker
(use-package debbugs)
(use-package gnus
;; Gmail integration taken from https://github.com/kensanata/ggg
:preface
(defun gmail-archive ()
"Archive the current or marked mails.
This moves them into the All Mail folder."
(interactive)
(gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/All Mail"))
(defun gmail-trash ()
"Trash the current or marked mails.
This moves them into the Trash folder."
(interactive)
(gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/Trash"))
(defun gmail-report-spam ()
"Report the current or marked mails as spam.
This moves them into the Spam folder."
(interactive)
(gnus-summary-move-article nil "nnimap+imap.gmail.com:[Gmail]/Spam"))
:bind
(:map
gnus-article-mode-map
(("q" . 'kill-current-buffer)))
(:map
gnus-summary-mode-map
:prefix-map gmail-prefix-map
:prefix "C-c"
(("y" . 'gmail-archive)
("d" . 'gmail-trash)
("$" . 'gmail-report-spam)))
:hook
;; Encrypt all messages
(message-setup . mml-secure-message-encrypt)
:custom
(gnus-agent nil)
(gnus-check-new-newsgroups nil)
(gnus-group-line-format "%M%S%p%P%B%(%G%) (%y)\n")
(gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]")
(gnus-init-file nil)
(gnus-message-archive-group nil)
(gnus-secondary-select-methods
'((nntp "news.gmane.io"
(nntp-connection-timeout 5))))
(gnus-select-method
'(nnimap "gmail"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)))
(gnus-sum-thread-tree-false-root "")
(gnus-sum-thread-tree-indent " ")
(gnus-sum-thread-tree-leaf-with-other "├► ")
(gnus-sum-thread-tree-root "")
(gnus-sum-thread-tree-single-leaf "╰► ")
(gnus-sum-thread-tree-vertical "│")
(gnus-summary-line-format "%U%R%z %([%&user-date;] %-20,20f %B%s%)\n")
(gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references)
(gnus-thread-hide-subtree t)
(gnus-thread-ignore-subject t)
(gnus-thread-indent-level 2)
(gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date))
(gnus-use-dribble-file nil)
(gnus-user-date-format-alist
'(((gnus-seconds-today) . "Today %10R")
((+ (* 60 60 24) (gnus-seconds-today)) . "Yesterday %6R")
(t . "%Y-%m-%d %R")))
(message-send-mail-function 'smtpmail-send-it)
(mml-secure-openpgp-encrypt-to-self t)
(mml-secure-openpgp-signers '("A52D68794EBED758"))
(smtpmail-smtp-server "smtp.gmail.com")
(smtpmail-smtp-service 587))
;;; Local Packages
(use-package leetcode
:vc
(:url "https://github.com/trevarj/leetcode.el"
:rev "9c5bd70")
:load my-secrets
:custom
(leetcode-directory "~/Workspace/leetcode/")
(leetcode-prefer-language "cpp")
(leetcode-save-solutions t))
(use-package aoc
:load my-secrets
:config
(setopt savehist-additional-variables
(append savehist-additional-variables '(aoc-year aoc-day-level))))
(use-package launch-program
:bind (("s-SPC" . launch-program-launch)))
(provide 'init)
;; Local Variables:
;; byte-compile-warnings: (not unresolved free-vars)
;; End:
;;; init.el ends here