-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.el
721 lines (615 loc) · 25 KB
/
config.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
;;; config-new.el -*- lexical-binding: t; -*-
(setq user-mail-address "[email protected]"
user-full-name "Edmund Miller")
(setq doom-scratch-initial-major-mode 'org-mode)
;;
;;; UI
;; "monospace" means use the system default. However, the default is usually two
;; points larger than I'd like, so I specify size 12 here.
(setq doom-theme 'catppuccin
catppuccin-flavor 'macchiato ;; or 'latte, 'frappe, or 'mocha
doom-font (font-spec :family "JetBrains Mono" :size 14)
doom-variable-pitch-font (font-spec :family "iA Writer Duospace" :size 16)
doom-unicode-font (font-spec :family "JuliaMono"))
;; Line numbers are pretty slow all around. The performance boost of
;; disabling them outweighs the utility of always keeping them on.
(setq display-line-numbers-type nil)
;; Prevents some cases of Emacs flickering
(add-to-list 'default-frame-alist '(inhibit-double-buffering . t))
;; Save bookmarks in sync
(setq! sync-dir "~/sync/"
bookmark-default-file (concat sync-dir ".local/" "bookmarks"))
;;
;;; Keybinds
(map! (:after evil-org
:map evil-org-mode-map
:n "gk" (cmd! (if (org-on-heading-p)
(org-backward-element)
(evil-previous-visual-line)))
:n "gj" (cmd! (if (org-on-heading-p)
(org-forward-element)
(evil-next-visual-line)))
:localleader
(:prefix ("r" . "refile")
"r" #'org-refile-reverse
"R" #'org-refile)) ; to all `org-refile-targets'
:leader
(:prefix "f"
:desc "Find file in dotfiles" :n "o" #'+emiller/find-in-dotfiles
:desc "Browse dotfiles" :n "O" #'+emiller/browse-dotfiles)
(:prefix "n"
"/" #'consult-org-agenda)
;; "b" #'org-roam-buffer-toggle
;; "d" #'org-roam-dailies-goto-today
;; "D" #'org-roam-dailies-goto-date
;; "i" #'org-roam-node-insert
;; "r" #'org-roam-node-find
;; "R" #'org-roam-capture)
(:prefix "i"
:desc "Insert date" :n "d" #'insert-todays-date)
(:prefix "r"
:desc "Codespaces" :n "c" #'codespaces-connect)
(:prefix "o"
:desc "Calc" :n "c" #'calc
:desc "APP: IRC" :n "i" #'=irc
;; :desc "APP: notmuch" :n "m" #'=mu4e
;; :desc "dired-sidebar" :n "n" #'dired-sidebar-toggle-sidebar
:desc "inbox.org" :n "o" #'+emiller/visit-inbox-org
:desc "projects" :n "p" #'+emiller/visit-projects
:desc "emms" :n "s" #'emms
:desc "APP: rss" :n "," #'=rss))
;;
;;; Modules
;;;
;;; :completion company
;; This used to be off by default
(after! company
(setq company-idle-delay nil))
;;; :completion corfu
(setq! orderless-component-separator #'orderless-escapable-split-on-space)
;; +lsp
(after! lsp-mode
(when (modulep! :completion corfu)
(setq lsp-completion-provider :none)
(add-hook 'lsp-mode-hook #'lsp-completion-mode)))
;;; :completion ivy
(after! ivy
;; I prefer search matching to be ordered; it's more precise
(add-to-list 'ivy-re-builders-alist '(counsel-projectile-find-file . ivy--regex-plus)))
;; Switch to the new window after splitting
(setq evil-split-window-below t
evil-vsplit-window-right t)
;;; :editor evil
(after! evil
(require 'evil-textobj-anyblock)
(evil-define-text-object my-evil-textobj-anyblock-inner-quote
(count &optional beg end type)
"Select the closest outer quote."
(let ((evil-textobj-anyblock-blocks
'(("'" . "'")
("\"" . "\"")
("`" . "`")
("“" . "”"))))
(evil-textobj-anyblock--make-textobj beg end type count nil)))
(evil-define-text-object my-evil-textobj-anyblock-a-quote
(count &optional beg end type)
"Select the closest outer quote."
(let ((evil-textobj-anyblock-blocks
'(("'" . "'")
("\"" . "\"")
("`" . "`")
("“" . "”"))))
(evil-textobj-anyblock--make-textobj beg end type count t)))
(define-key evil-inner-text-objects-map "q" 'my-evil-textobj-anyblock-inner-quote)
(define-key evil-outer-text-objects-map "q" 'my-evil-textobj-anyblock-a-quote))
;;; :editor file-templates
;;; TODO
;;; :emacs dired
;;Get rid of dired message when using "a"
(put 'dired-find-alternate-file 'disabled nil)
;;; :ui doom-dashboard
;; NARF
(setq fancy-splash-image (concat doom-private-dir "narf.png"))
;; Don't need the menu; I know them all by heart
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
;;; :checks grammar
(after! langtool
(setq langtool-bin "languagetool-commandline"))
;;; :tools biblio
(setq! citar-library-paths '("~/sync/papers/")
citar-bibliography '("~/sync/reference/bibliography.bib"
"~/sync/reference/biochemistry.bib"
"~/sync/reference/genomics.bib"
"~/sync/reference/molecular_biology.bib"
"~/sync/reference/molecular_biology_project.bib"
;; "~/sync/reference/nascent_pipeline.bib"
"~/sync/reference/viralintegration.bib"
"~/sync/reference/books.bib")
citar-notes-paths '("~/sync/org/roam/lit"
"~/sync/org/roam/lit/book"
"~/sync/org/roam/lit/papers"
"~/sync/org/roam/lit/papers/biology"
"~/sync/org/roam/lit/biochemistry")
citar-org-roam-subdir "lit/stack")
(set-formatter! 'bibtex-tidy '("npx" "bibtex-tidy" "--v2" "--quiet" "-"
;; Opinions
"--blank-lines"
"--sort"
"--duplicates"
"--merge"
"--tidy-comments"
) :modes '(bibtex-mode))
;;; :tools direnv
(setq direnv-always-show-summary nil)
;;; :tools lsp
;; Disable invasive lsp-mode features
(after! lsp-mode
(setq lsp-enable-symbol-highlighting nil
;; If an LSP server isn't present when I start a prog-mode buffer, you
;; don't need to tell me. I know. On some systems I don't care to have a
;; whole development environment for some ecosystems.
lsp-enable-server-download nil
lsp-enable-suggest-server-download nil))
(after! lsp-ui
(setq lsp-ui-sideline-enable nil ; no more useful than flycheck
lsp-ui-doc-enable nil)) ; redundant with K
;;; :tools magit
(setq magit-repository-directories '(("~/src" . 3))
magit-save-repository-buffers nil
;; Don't restore the wconf after quitting magit, it's jarring
magit-inhibit-save-previous-winconf t
evil-collection-magit-want-horizontal-movement t
magit-openpgp-default-signing-key "~/.ssh/id_ed25519"
transient-values '((magit-rebase "--autosquash" "--autostash")
(magit-pull "--rebase" "--autostash")
(magit-revert "--autostash")))
;; Enable git gutter on tramp sessions
(defun +version-control|git-gutter-maybe ()
(when buffer-file-name
(require 'git-gutter-fringe)
(git-gutter-mode +1)))
(setenv "EDITOR" "emacsclient")
;;; :lang clojure
(after! cider
(set-popup-rules!
'(("^\\*cider-error*" :ignore t)
("^\\*cider-repl" :quit nil)
("^\\*cider-repl-history" :vslot 2 :ttl nil))))
;;; :lang julia
(use-package! julia-formatter
:hook (julia-mode-hook . julia-formatter-mode))
(add-to-list '+org-babel-mode-alist '(julia . julia-snail))
;;; :lang ledger
(add-to-list 'auto-mode-alist '("\\.\\(h?ledger\\|journal\\|j\\)$" . ledger-mode))
;;; :lang nix
(set-formatter! 'alejandra '("alejandra" "--quiet") :modes '(nix-mode))
(set-formatter! 'nixfmt-rfc-style '("nixfmt" "--quiet") :modes '(nix-mode))
;;; :lang org
(setq! +org-roam-auto-backlinks-buffer nil ;; This messes up org-noter
org-directory "~/sync/org/"
org-roam-directory (concat org-directory "roam/")
org-roam-db-location (file-name-concat org-directory ".org-roam.db")
org-roam-dailies-directory "journal/"
org-archive-location (concat org-directory ".archive/%s::")
+org-capture-todo-file (file-name-concat org-directory "roam/project/inbox.org")
+org-capture-projects-file (file-name-concat org-directory "roam/project/projects.org")
;; Agenda
org-agenda-files (list (concat org-directory "roam/project"))
org-agenda-skip-additional-timestamps-same-entry t)
(after! org
(setq org-startup-folded 'show2levels
org-ellipsis " [...] "
org-export-with-toc nil
org-pomodoro-length 20
org-log-done 'time
;; Fix org-id on SPC-l-s
;; org-id-link-to-org-use-id 'use-existing
org-deadline-warning-days 5
org-capture-templates
(append
;; TODO generalize these with org-directory
'(("a" "Appointment" entry (file "~/sync/org/schedule.org")
"* %?\n\n%^T\n\n:PROPERTIES:\n\n:END:\n\n")
("e" "Lab Entry" entry
(file+olp+datetree "~/sync/org/roam/lab/2024.org")
"* %?\n%i")
("l" "Link" entry (file+headline "~/sync/org/links.org" "Links")
"* %a %^g\n %?\n %i" :immediate-finish t))
org-capture-templates)))
(use-package! org-modern
;; TODO :when (modulep! :lang org +modern)
:hook (org-mode . global-org-modern-mode)
:custom
(org-modern-priority
`((?A . ,(propertize "⚑" 'face 'error))
(?B . ,(propertize "⬆" 'face 'warning))
(?C . ,(propertize "■" 'face 'success))))
:custom-face (org-modern-label ((t :inherit default :height 1.0))))
;; org-agenda
(use-package! org-super-agenda
:after org-agenda
:commands (org-super-agenda-mode)
:init (advice-add #'org-super-agenda-mode :around #'doom-shut-up-a)
:config
(setq!
;; https://librephoenix.com/2023-12-30-making-org-agenda-look-beautiful
;; Only show two days of the agenda at a time
org-agenda-span 2
org-agenda-start-day "+0d"
;; Hide duplicates of the same todo item
;; If it has more than one of timestamp, scheduled,
;; or deadline information
org-agenda-skip-timestamp-if-done t
org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t
org-agenda-skip-scheduled-if-deadline-is-shown t
org-agenda-skip-timestamp-if-deadline-is-shown t
;; Ricing org agenda
org-agenda-current-time-string ""
org-agenda-time-grid '((daily) () "" ""))
;; TODO Category Icons
(setq! org-agenda-custom-commands
(append
'(("1" "Q1" tags-todo "+important+urgent")
("2" "Q2" tags-todo "+important-urgent")
("3" "Q3" tags-todo "-important+urgent")
("4" "Q4" tags-todo "-important-urgent")
;; https://systemcrafters.net/org-mode-productivity/custom-org-agenda-views/#weekly-review
("p" "Planning"
((tags-todo "+@planning"
((org-agenda-overriding-header "Planning Tasks")))
(tags-todo "-{.*}"
((org-agenda-overriding-header "Untagged Tasks")))
;; FIXME Remove hardcoded file
(todo ".*" ((org-agenda-files '("~/sync/org/roam/project/inbox.org"))
(org-agenda-overriding-header "Unprocessed Inbox Items")))))
("d" "Daily Agenda"
((agenda "" ((org-agenda-span 'day)
(org-deadline-warning-days 7)))
(tags-todo "+PRIORITY=\"A\""
((org-agenda-overriding-header "High Priority Tasks")))))
("w" "Weekly Review"
((agenda ""
((org-agenda-overriding-header "Completed Tasks")
;; (org-agenda-start-with-log-mode t)
(org-agenda-log-mode-items '(closed))
(org-agenda-show-log t)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'done))
(org-agenda-span 'week)))
(agenda ""
((org-agenda-overriding-header "Unfinished Scheduled Tasks")
(org-agenda-log-mode-items '(clock))
(org-agenda-show-log t)
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-span 'week))))))))
(setq! org-super-agenda-mode t)
(setq! org-super-agenda-header-map evil-org-agenda-mode-map
org-super-agenda-groups
'(;; Each group has an implicit boolean OR operator between its selectors.
(:name " Overdue " ; Optionally specify section name
:scheduled past
:order 2
:face 'error)
(:name "Family "
:and(:discard (:file-path "calendar-beorg"))
:order 3)
(:name "Writing "
:and(:discard (:file-path "calendar-beorg"))
:order 3)
(:name "Learning "
:and(:discard (:file-path "calendar-beorg"))
:order 3)
(:name " Today " ; Optionally specify section name
:time-grid t
:date today
:scheduled today
:order 1
:face 'warning))))
(after! org-roam
(setq org-roam-capture-templates
`(("n" "note" plain
,(format "#+title: ${title}\n%%[%s/template/note-org]" org-roam-directory)
:target (file "note/%<%Y%m%d%H%M%S>-${slug}.org")
:unnarrowed t)
("r" "thought" plain
,(format "#+title: ${title}\n%%[%s/template/thought-org]" org-roam-directory)
:target (file "thought/%<%Y%m%d%H%M%S>-${slug}.org")
:unnarrowed t)
("t" "topic" plain
,(format "#+title: ${title}\n%%[%s/template/topic-org]" org-roam-directory)
:target (file "topic/%<%Y%m%d%H%M%S>-${slug}.org")
:unnarrowed t)
("c" "contact" plain
,(format "#+title: ${title}\n%%[%s/template/contact-org]" org-roam-directory)
:target (file "contact/%<%Y%m%d%H%M%S>-${slug}.org")
:unnarrowed t)
("p" "project" plain
,(format "#+title: ${title}\n%%[%s/template/project-org]" org-roam-directory)
:target (file "project/%<%Y%m%d>-${slug}.org")
:unnarrowed t)
("i" "invoice" plain
,(format "#+title: %%<%%Y%%m%%d>-${title}\n%%[%s/template/invoice-org]" org-roam-directory)
:target (file "invoice/%<%Y%m%d>-${slug}.org")
:unnarrowed t)
("f" "ref" plain
,(format "#+title: ${title}\n%%[%s/template/ref-org]" org-roam-directory)
:target (file "ref/%<%Y%m%d%H%M%S>-${slug}.org")
:unnarrowed t)
("w" "weekly" plain
,(format "#+title: ${title}\n%%[%s/template/weekly-org]" org-roam-directory)
:target (file "journal/weekly_review/%<%Y-%m-%d>.org.age")
:unnarrowed t)
("s" "secret" plain "#+title: ${title}\n\n"
:target (file "secret/%<%Y%m%d%H%M%S>-${slug}.org.age")
:unnarrowed t))
;; Use human readable dates for dailies titles
org-roam-dailies-capture-templates
`(("d" "default" plain ""
:target (file+head "%<%Y-%m-%d>.org" ,(format "%%[%s/template/daily-org]" org-roam-directory))))))
(after! org-tree-slide
;; I use g{h,j,k} to traverse headings and TAB to toggle their visibility, and
;; leave C-left/C-right to . I'll do a lot of movement because my
;; presentations tend not to be very linear.
(setq org-tree-slide-skip-outline-level 2))
(defvar org-contacts-files '("~/sync/org/contacts.org"))
;; To make `org-latex-preview` work
(after! org
(setq org-latex-default-packages-alist
'(("AUTO" "inputenc" t
("pdflatex"))
("T1" "fontenc" t
("pdflatex"))
("" "graphicx" t)
("" "grffile" nil)
("" "longtable" nil)
("" "wrapfig" nil)
("" "rotating" nil)
("normalem" "ulem" t)
("" "amsmath" t)
("" "textcomp" t)
("" "amssymb" t)
("" "capt-of" nil)
("" "hyperref" nil))))
;; LaTeX Export
;; org-latex-compilers = ("pdflatex" "xelatex" "lualatex"), which are the possible values for %latex
(setq org-latex-pdf-process '("LC_ALL=en_US.UTF-8 latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode -output-directory=%o %f"))
;; I like to cross things off my todo list
(custom-set-faces! '(org-headline-done :strike-through t))
;; Start in insert mode in org-capture
(add-hook 'org-capture-mode-hook 'evil-insert-state)
;; +journal
(after! org
(setq org-journal-dir (concat org-directory "journal/")
org-journal-file-type 'monthly
org-journal-encrypt-journal nil
org-journal-enable-cache t
org-journal-file-format "%Y%m%d.org.age")
(remove-hook 'calendar-today-visible-hook 'org-journal-mark-entries))
;; +noter
(after! org-noter
(setq org-noter-always-create-frame t
org-noter-doc-split-fraction '(0.75 . 0.25)
org-noter-separate-notes-from-heading t
org-noter-default-heading-title "Page $p$"
org-noter-auto-save-last-location t
org-noter-notes-search-path citar-notes-paths
org-noter-separate-notes-from-heading t
org-noter-doc-property-in-notes t))
;; #+beamer_theme: [progressbar=foot]metropolis
;; org-roam-ui
(use-package! websocket
:after org-roam)
(use-package! org-roam-ui
:after org-roam ;; or :after org
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
(use-package! org-roam-timestamps
:after org-roam
:config
(setq org-roam-timestamps-parent-file t))
;; org-transclusion
(use-package! org-transclusion
:after org)
;;; :lang python
;; FIXME this breaks snakefmt
;; (setq-hook! 'python-mode-hook +format-with 'ruff)
;;; :lang R
(set-formatter!
'styler
'("R" "-s" "--no-save" "--no-restore" "-e" "styler::style_text(readLines(file('stdin')))")
:modes '(ess-r-mode))
;;; :lang rust
(setq rustic-lsp-server 'rust-analyzer)
;;; :lang solidity
(setq flycheck-solidity-solium-soliumrcfile "/home/emiller/sync/.soliumrc.json"
solidity-flycheck-solc-checker-active t)
;;; :lang web
;; Hook into vue-lsp
(add-hook 'web-mode-local-vars-hook #'lsp!)
;;; :email mu4e
;; Each path is relative to `+mu4e-mu4e-mail-path', which is ~/.mail by default
(after! mu4e
(setq shr-use-colors nil)
(set-email-account! "Gmail"
'((mu4e-sent-folder . "/Gmail/[Gmail]/Sent Mail")
(mu4e-drafts-folder . "/Gmail/[Gmail]/Drafts")
(mu4e-trash-folder . "/Gmail/[Gmail]/Trash")
(mu4e-refile-folder . "/Gmail/[Gmail]/Archive")
(smtpmail-smtp-user . "[email protected]")
(mu4e-compose-signature . "---\nEdmund Miller"))
t)
(set-email-account! "UTD"
'((mu4e-sent-folder . "/UTD/Sent")
(mu4e-drafts-folder . "/UTD/Drafts")
(mu4e-trash-folder . "/UTD/Trash")
(mu4e-refile-folder . "/UTD/Archive")
(smtpmail-smtp-user . "[email protected]")
(mu4e-compose-signature . "---\nEdmund Miller"))
t))
(use-package! mu4e-patch
:hook (mu4e-view-mode . mu4e-patch-highlight))
;;; :app everywhere
(after! emacs-everywhere
;; Easier to match with a bspwm rule:
;; bspc rule -a 'Emacs:emacs-everywhere' state=floating sticky=on
(setq emacs-everywhere-frame-name-format "emacs-anywhere")
;; The modeline is not useful to me in the popup window. It looks much nicer
;; to hide it.
(remove-hook 'emacs-everywhere-init-hooks #'hide-mode-line-mode)
;; Semi-center it over the target window, rather than at the cursor position
;; (which could be anywhere).
(defadvice! center-emacs-everywhere-in-origin-window (frame window-info)
:override #'emacs-everywhere-set-frame-position
(cl-destructuring-bind (x y width height)
(emacs-everywhere-window-geometry window-info)
(set-frame-position frame
(+ x (/ width 2) (- (/ width 2)))
(+ y (/ height 2))))))
;;; :app irc
(after! circe
(set-irc-server! "chat.freenode.net"
`(:tls t
:port 6697
:nick "emiller88"
:sasl-username ,(+pass-get-user "irc/freenode.net")
:sasl-password (lambda (&rest _) (+pass-get-secret "irc/freenode.net"))
:channels ("#bioinformatics" "#clojure" "#emacs" "#emacs-circe" "#guix" "#guile" "#home-manager" "#nixos" "#nixos-emacs" "#sway" "##rust" "#python" "#pine64"))))
;;; :app rss
(after! elfeed-search
(map! :map elfeed-search-mode-map
:localleader
:n "m" #'my/elfeed-search-view-hydra/body
:n "s" #'elfeed-toggle-star
:n "v" #'elfeed-view-mpv
:n "r" #'elfeed-update))
;; Set max width
(after! elfeed
(setq elfeed-search-title-max-width 120
elfeed-goodies/feed-source-column-width 25
elfeed-search-filter "@1-week-ago--1-day-ago -youtube"))
(use-package! elfeed-tube
:after elfeed
:init
(map! :map elfeed-show-mode-map
:localleader
:n "F" #'elfeed-tube-fetch
:map elfeed-search-mode-map
:localleader
:n "F" #'elfeed-tube-fetch)
:config
;; (setq elfeed-tube-auto-save-p nil) ; default value
;; (setq elfeed-tube-auto-fetch-p t) ; default value
(elfeed-tube-setup))
;;
;;; Language customizations
(custom-theme-set-faces! 'doom-dracula
`(markdown-code-face :background ,(doom-darken 'bg 0.075))
`(font-lock-variable-name-face :foreground ,(doom-lighten 'magenta 0.6)))
;; spell
(setq ispell-personal-dictionary
(expand-file-name "misc/ispell_personal" doom-private-dir))
;; sql-mode
(set-formatter! 'sqruff '("sqruff" "fix" "--force" "-") :modes '(sql-mode))
;;
;;; Packages
(use-package! org-nix-shell
:hook (org-mode . org-nix-shell-mode))
(use-package! codespaces
:config (codespaces-setup))
(use-package! graphviz-dot-mode)
(use-package! jest)
(use-package! ob-duckdb)
(use-package! ox-chameleon
:after ox)
(use-package! engrave-faces
:after ox-latex
:config
(setq org-latex-listings 'engraved))
(use-package! academic-phrases)
(use-package! gh-notify)
(use-package! webpaste
:config
(progn
(setq webpaste-provider-priority '("ix.io" "dpaste.org"))))
(use-package! mastodon
:init
(setq mastodon-instance-url "https://genomic.social"
mastodon-active-user "emiller")
:config
(mastodon-discover))
(use-package! conf-data-toml
:magic ("\\`data_config_version = [0-9]" . conf-data-toml-mode))
(use-package! agenix
:mode ("\\.age\\'" . agenix-mode)
:config
(add-hook 'agenix-pre-mode-hook #'envrc-mode)
(add-to-list 'agenix-key-files "~/.ssh/id_ed25519")
(add-to-list 'agenix-key-files "/etc/ssh/host_ed25519")
(dolist (file (doom-glob "~/.ssh/*/id_ed25519"))
(add-to-list 'agenix-key-files file)))
(use-package! nushell-ts-mode)
(use-package! nushell-ts-babel
:after nushell-ts-mode)
(use-package! age
:init
(setq! age-program "rage"
age-default-identity
'("~/.ssh/id_ed25519"
"~/.secrets/journal.txt")
age-default-recipient
'("~/.ssh/id_ed25519.pub"
"~/.secrets/journal_recipients.txt"))
(push (file-name-concat doom-profile-state-dir "authinfo.age") auth-sources)
:config
(age-file-enable))
(use-package! difftastic
:after magit
:bind (:map magit-blame-read-only-mode-map
("D" . difftastic-magit-show)
("S" . difftastic-magit-show))
:config
(eval-after-load 'magit-diff
'(transient-append-suffix 'magit-diff '(-1 -1)
[("D" "Difftastic diff (dwim)" difftastic-magit-diff)
("S" "Difftastic show" difftastic-magit-show)])))
(use-package! sqlformat
:after sql
:config (setq sqlformat-command 'sqlfluff)
:bind (:map sql-mode-map
("C-c c f" . 'sqlformat)))
(use-package! tldr
:config
(setq tldr-directory-path (concat doom-etc-dir "tldr/")
tldr-enabled-categories '("common" "linux")))
(use-package! auth-source-1password
:config
(setq! auth-source-1password-vault "Private")
(auth-source-1password-enable))
(use-package! just-mode)
(use-package! justl
:config
(map! :map justl-mode-map
:localleader
:n "e" 'justl-exec-recipe))
(use-package! outline-yaml
:hook
((yaml-mode . outline-yaml-minor-mode)
(yaml-ts-mode . outline-yaml-minor-mode)))
;;; Custom Variables
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(safe-local-variable-values
'((ssh-deploy-async-with-threads . 1)
(ssh-deploy-on-explicity-save . t)
(ssh-deploy-async . 1))))
(setq enable-local-variables :all)