-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.el
819 lines (720 loc) · 28.6 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
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
;; [[file:config.org::*File variables][File variables:1]]
;;; ~/.config/doom/config.el -*- lexical-binding: t; -*-
;; File variables:1 ends here
;; [[file:config.org::*Personal information][Personal information:1]]
(setq user-full-name "James Ravn"
user-mail-address "[email protected]"
calendar-latitude 51.508166
calendar-longitude -0.075971
calendar-location-name "London, UK")
;; Personal information:1 ends here
;; [[file:config.org::*Theme][Theme:1]]
(letrec ((base
; adjust font size based on system
(cond ((equal "loki" (system-name)) 6)
(t 0))))
(setq doom-theme 'doom-one
doom-font (font-spec :family "PragmataPro Liga" :size (+ base 16))
doom-variable-pitch-font (font-spec :family "DejaVu Sans" :size (+ base 14))
doom-big-font (font-spec :family "PragmataPro Liga" :size (+ base 20))
doom-unicode-font (font-spec :family "Noto Color Emoji" :size (+ base 16))
+pretty-code-pragmata-pro-font-name "PragmataPro Liga")
)
;; Theme:1 ends here
;; [[file:config.org::*Theme][Theme:2]]
(setq fancy-splash-image (concat doom-private-dir "splash.png"))
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
;; Theme:2 ends here
;; [[file:config.org::*Mixed pitch mode][Mixed pitch mode:1]]
(add-hook! (org-mode gfm-mode markdown-mode) #'mixed-pitch-mode)
(setq mixed-pitch-set-height t)
;; Mixed pitch mode:1 ends here
;; [[file:config.org::*Maximize][Maximize:1]]
;; (add-to-list 'default-frame-alist '(fullscreen . maximized))
;; Maximize:1 ends here
;; [[file:config.org::*Editor behavior][Editor behavior:1]]
(remove-hook 'doom-first-buffer-hook #'ws-butler-global-mode)
(after! editorconfig
(setq editorconfig-trim-whitespaces-mode nil))
; Default doom threshold of 400 is too low in my experience.
(after! so-long (setq so-long-threshold 4000))
;; Editor behavior:1 ends here
;; [[file:config.org::*Editor behavior][Editor behavior:2]]
(setq whitespace-style '(face indentation trailing lines-tail))
(global-whitespace-mode t)
;; Editor behavior:2 ends here
;; [[file:config.org::*Editor behavior][Editor behavior:3]]
(setq confirm-kill-emacs nil)
;; Editor behavior:3 ends here
;; [[file:config.org::*Deletion][Deletion:1]]
;(setq delete-by-moving-to-trash t)
;; Deletion:1 ends here
;; [[file:config.org::*Deletion][Deletion:2]]
(setq evil-want-fine-undo t)
;; Deletion:2 ends here
;; [[file:config.org::*Auto-save][Auto-save:1]]
(setq auto-save-visited-interval 5) ; Save after 5s of idle time.
(auto-save-visited-mode t)
;; Auto-save:1 ends here
;; [[file:config.org::*Auto-save][Auto-save:2]]
(add-hook! '(doom-switch-buffer-hook
doom-switch-window-hook)
(if (buffer-file-name) (save-some-buffers t))) ; avoid saving when switching to a non-file buffer
(add-function :after after-focus-change-function
(lambda () (save-some-buffers t)))
;; Auto-save:2 ends here
;; [[file:config.org::*Line wrapping][Line wrapping:1]]
(setq-default fill-column 120)
(add-hook! '(text-mode-hook prog-mode-hook conf-mode-hook)
#'display-fill-column-indicator-mode)
;; Line wrapping:1 ends here
;; [[file:config.org::*Line wrapping][Line wrapping:2]]
;; (remove-hook 'text-mode-hook #'auto-fill-mode)
;; (add-hook 'text-mode-hook #'+word-wrap-mode)
;; Line wrapping:2 ends here
;; [[file:config.org::*Window splitting][Window splitting:1]]
(setq evil-vsplit-window-right t
evil-split-window-below t)
;; Window splitting:1 ends here
;; [[file:config.org::*Window splitting][Window splitting:2]]
(setq split-width-threshold 240)
;; Window splitting:2 ends here
;; [[file:config.org::*Clipboard and Copy/Paste][Clipboard and Copy/Paste:1]]
(setq select-enable-clipboard t)
;; Clipboard and Copy/Paste:1 ends here
;; [[file:config.org::*Clipboard and Copy/Paste][Clipboard and Copy/Paste:2]]
(map!
:i "C-S-v" #'yank)
;; Clipboard and Copy/Paste:2 ends here
;; [[file:config.org::*Which-key][Which-key:1]]
(setq which-key-idle-delay 0.5)
;; Which-key:1 ends here
;; [[file:config.org::*Authinfo][Authinfo:1]]
(setq auth-sources '("~/.authinfo.gpg"))
;; Authinfo:1 ends here
;; [[file:config.org::*caddyfile-mode][caddyfile-mode:1]]
(use-package caddyfile-mode
:mode (("Caddyfile\\'" . caddyfile-mode)
("Corefile\\'" . caddyfile-mode)
("caddy\\.conf\\'" . caddyfile-mode)))
;; caddyfile-mode:1 ends here
;; [[file:config.org::*Projects][Projects:1]]
(setq projectile-project-search-path '("~/devel/" "~/sky" "~/gatech"))
;; Projects:1 ends here
;; [[file:config.org::*Projects][Projects:2]]
(after! projectile
(add-to-list 'projectile-project-root-files "go.mod"))
;; Projects:2 ends here
;; [[file:config.org::*Projects][Projects:3]]
(defun +private/projectile-invalidate-cache (&rest _args)
(projectile-invalidate-cache nil))
(advice-add 'magit-checkout
:after #'+private/projectile-invalidate-cache)
(advice-add 'magit-branch-and-checkout
:after #'+private/projectile-invalidate-cache)
;; Projects:3 ends here
;; [[file:config.org::*Smart parentheses][Smart parentheses:1]]
(map!
:ni "M-u" #'sp-up-sexp)
;; Smart parentheses:1 ends here
;; [[file:config.org::*Workspaces][Workspaces:1]]
(setq +workspaces-on-switch-project-behavior t)
;; Workspaces:1 ends here
;; [[file:config.org::*Workspaces][Workspaces:2]]
(map! :leader
(:prefix-map ("TAB" . "workspace")
:desc "Switch to last workspace" "," #'+workspace/other
))
;; Workspaces:2 ends here
;; [[file:config.org::*Zen][Zen:1]]
(after! writeroom-mode
(setq +zen-text-scale 0
+zen-mixed-pitch-modes nil
writeroom-mode-line t
writeroom-width 160))
;; Zen:1 ends here
;; [[file:config.org::*Treemacs][Treemacs:1]]
(after! treemacs
(treemacs-follow-mode 1)
(setq treemacs-width 40))
;; Treemacs:1 ends here
;; [[file:config.org::*Pretty-code][Pretty-code:1]]
(setq +pretty-code-symbols nil)
;; Pretty-code:1 ends here
;; [[file:config.org::*Completion][Completion:1]]
;; (after! company
;; (remove-hook 'evil-normal-state-entry-hook #'company-abort))
;(setq company-idle-delay 0.1)
(setq +lsp-company-backends '(:separate company-capf company-yasnippet))
;; Completion:1 ends here
;; [[file:config.org::*Configuration][Configuration:1]]
(set-email-account!
"r-vn.org"
'((mu4e-sent-folder . "/r-vn.org/Sent")
(mu4e-drafts-folder . "/r-vn.org/Drafts")
(mu4e-trash-folder . "/r-vn.org/Trash")
(mu4e-refile-folder . "/r-vn.org/Archive")
(smtpmail-smtp-user . "[email protected]")
(mu4e-maildir-shortcuts .
((:maildir "/r-vn.org/INBOX" :key ?i)
(:maildir "/r-vn.org/Archive" :key ?a)
(:maildir "/r-vn.org/Trash" :key ?t)
(:maildir "/r-vn.org/Sent" :key ?s)))
(smtpmail-smtp-server . "smtp.fastmail.com")
(smtpmail-stream-type . ssl)
(smtpmail-smtp-service . 465)
(smtpmail-default-smtp-server . "smtp.fastmail.com"))
t)
;; Configuration:1 ends here
;; [[file:config.org::*Configuration][Configuration:2]]
(after! mu4e
(setq mu4e-attachment-dir "~/Downloads" ; Attachments in standard place.
mu4e-headers-include-related nil ; Only show messages which match the current filter.
mu4e-headers-fields ; Header columns.
'((:human-date . 12)
(:flags . 6)
(:from . 25)
(:subject))
mu4e-update-interval 300)) ; Check for mail every 5 minutes.
;; Configuration:2 ends here
;; [[file:config.org::*Configuration][Configuration:3]]
(remove-hook 'mu4e-compose-mode-hook #'org-mu4e-compose-org-mode) ; Don't use org-mu4e.
(use-package org-msg
:after (org mu4e)
:hook (mu4e-main-mode . org-msg-mode)
:config
(setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t"
org-msg-startup "hidestars indent inlineimages"
org-msg-greeting-fmt "\nHi %s,\n\n"
org-msg-greeting-name-limit 3
org-msg-text-plain-alternative t
org-msg-signature "
Kind regards,
#+begin_signature
-- James
#+end_signature"))
;; Configuration:3 ends here
;; [[file:config.org::*Configuration][Configuration:4]]
(map!
:leader
:prefix "o"
:desc "Mail" "m" #'=mu4e)
;; Configuration:4 ends here
;; [[file:config.org::*Configuration][Configuration:5]]
(setq shr-color-visible-luminance-min 80)
;; Configuration:5 ends here
;; [[file:config.org::*Language Server Protocol (LSP)][Language Server Protocol (LSP):1]]
(map! :leader
(:prefix "c"
:desc "LSP Parameters" "p" #'lsp-signature-activate))
;; Language Server Protocol (LSP):1 ends here
;; [[file:config.org::*Language Server Protocol (LSP)][Language Server Protocol (LSP):2]]
(setq lsp-auto-guess-root nil ; Causes problems esp. with golang projects misguessing the root.
lsp-enable-symbol-highlighting nil ; Lots of highlighting that is distracting.
lsp-signature-auto-activate t ; Show signature of current function.
lsp-signature-render-documentation nil ; Only show single line of function.
lsp-enable-snippet nil ; Disable auto parameter insertions.
lsp-headerline-breadcrumb-enable nil ; Disable header breadcrumbs, it's redundant w/ the modeline.
lsp-file-watch-threshold 99999 ; Set a much higher file watch limit than the default 1000.
flycheck-check-syntax-automatically '(save idle-change new-line mode-enabled)) ; Restore lsp-mode flycheck behavior.
;; Language Server Protocol (LSP):2 ends here
;; [[file:config.org::*Language Server Protocol (LSP)][Language Server Protocol (LSP):3]]
;(setq lsp-log-io t)
;; Language Server Protocol (LSP):3 ends here
;; [[file:config.org::*Language Server Protocol (LSP)][Language Server Protocol (LSP):4]]
;; (defun lsp-notify-wrapper (params)
;; (let ((lsp--virtual-buffer-mappings (ht)))
;; (pcase (plist-get params :method)
;; (`"textDocument/didChange"
;; (setq my/params params)
;; (-let [(&plist :params
;; (&plist :textDocument (&plist :uri :version)
;; :contentChanges [(&plist :range (&plist :start :end )
;; :text)]))
;; params]
;; (with-current-buffer (get-buffer-create (format "*%s*" (f-filename (lsp--uri-to-path uri))))
;; (let ((start-point (if start
;; (lsp--position-to-point (ht ("line" (plist-get start :line))
;; ("character" (plist-get start :character))))
;; (point-min)))
;; (end-point (if end
;; (lsp--position-to-point (ht ("line" (plist-get end :line))
;; ("character" (plist-get end :character))))
;; (point-max))))
;; ;; (display-buffer-in-side-window (current-buffer) ())
;; (delete-region start-point end-point)
;; (goto-char start-point)
;; (insert text)))))
;; (`"textDocument/didOpen"
;; (-let [(&plist :params (&plist :textDocument
;; (&plist :uri
;; :version
;; :text)))
;; params]
;; (with-current-buffer (get-buffer-create (format "*%s*" (f-filename (lsp--uri-to-path uri))))
;; ;; (display-buffer-in-side-window (current-buffer) ())
;; (delete-region (point-min) (point-max))
;; (insert (or text ""))))))))
;; (advice-add 'lsp--send-notification :before 'lsp-notify-wrapper)
;; Language Server Protocol (LSP):4 ends here
;; [[file:config.org::*Magit][Magit:1]]
(setq magit-prefer-remote-upstream t)
;; Magit:1 ends here
;; [[file:config.org::*Magit][Magit:2]]
(setq forge-topic-list-limit '(30 . 6))
;; Magit:2 ends here
;; [[file:config.org::*Python][Python:1]]
(setq lsp-python-ms-executable (executable-find "python-language-server"))
;; Python:1 ends here
;; [[file:config.org::*Golang][Golang:1]]
(setq lsp-gopls-hover-kind "FullDocumentation")
;; Golang:1 ends here
;; [[file:config.org::*Org Mode][Org Mode:1]]
(setq org-directory "~/Notes/")
;; Org Mode:1 ends here
;; [[file:config.org::*Editor][Editor:1]]
(setq org-imenu-depth 6)
;; Editor:1 ends here
;; [[file:config.org::*Visuals][Visuals:1]]
(custom-set-faces!
'(outline-1 :weight extra-bold :height 1.12)
'(outline-2 :weight bold :height 1.10)
'(outline-3 :weight bold :height 1.08)
'(outline-4 :weight semi-bold :height 1.06)
'(outline-5 :weight semi-bold :height 1.04)
'(outline-6 :weight semi-bold :height 1.02)
'(outline-8 :weight semi-bold)
'(outline-9 :weight semi-bold))
;; Visuals:1 ends here
;; [[file:config.org::*Visuals][Visuals:2]]
(setq
org-ellipsis " ▼ "
org-superstar-headline-bullets-list '("☰" "☱" "☲" "☳" "☴" "☵" "☶" "☷" "☷" "☷" "☷"))
;; Visuals:2 ends here
;; [[file:config.org::*Archiving][Archiving:1]]
(setq org-archive-location (concat org-directory ".archive/%s::"))
(after! org (setq org-archive-subtree-add-inherited-tags t))
;; Archiving:1 ends here
;; [[file:config.org::*Download][Download:1]]
(after! org-download
(setq org-download-screenshot-method
(cond (IS-MAC "screencapture -i %s")
(IS-LINUX "~/.config/sway/capture.sh %s"))))
;; Download:1 ends here
;; [[file:config.org::*Exporting (General)][Exporting (General):1]]
(after! org (setq org-export-headline-levels 6))
;; Exporting (General):1 ends here
;; [[file:config.org::*Exporting to HTML][Exporting to HTML:1]]
(defun jsravn--org-inline-css-hook (exporter)
"Insert custom inline css to automatically set the
background of code to whatever theme I'm using's background"
(when (eq exporter 'html)
(setq
org-html-head-extra
(concat
(if (s-contains-p "<!––tec/custom-head-start-->" org-html-head-extra)
(s-replace-regexp "<!––tec/custom-head-start-->.*<!––tec/custom-head-end-->" "" org-html-head-extra)
org-html-head-extra)
(format "<!––tec/custom-head-start-->
<style type=\"text/css\">
:root {
--theme-bg: %s;
--theme-bg-alt: %s;
--theme-base0: %s;
--theme-base1: %s;
--theme-base2: %s;
--theme-base3: %s;
--theme-base4: %s;
--theme-base5: %s;
--theme-base6: %s;
--theme-base7: %s;
--theme-base8: %s;
--theme-fg: %s;
--theme-fg-alt: %s;
--theme-grey: %s;
--theme-red: %s;
--theme-orange: %s;
--theme-green: %s;
--theme-teal: %s;
--theme-yellow: %s;
--theme-blue: %s;
--theme-dark-blue: %s;
--theme-magenta: %s;
--theme-violet: %s;
--theme-cyan: %s;
--theme-dark-cyan: %s;
}
</style>"
(doom-color 'bg)
(doom-color 'bg-alt)
(doom-color 'base0)
(doom-color 'base1)
(doom-color 'base2)
(doom-color 'base3)
(doom-color 'base4)
(doom-color 'base5)
(doom-color 'base6)
(doom-color 'base7)
(doom-color 'base8)
(doom-color 'fg)
(doom-color 'fg-alt)
(doom-color 'grey)
(doom-color 'red)
(doom-color 'orange)
(doom-color 'green)
(doom-color 'teal)
(doom-color 'yellow)
(doom-color 'blue)
(doom-color 'dark-blue)
(doom-color 'magenta)
(doom-color 'violet)
(doom-color 'cyan)
(doom-color 'dark-cyan))
"
<link rel='stylesheet' type='text/css' href='https://fniessen.github.io/org-html-themes/org/readtheorg/css/htmlize.css'/>
<link rel='stylesheet' type='text/css' href='https://fniessen.github.io/org-html-themes/org/readtheorg/css/readtheorg.css'/>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js'></script>
<script type='text/javascript' src='https://fniessen.github.io/org-html-themes/org/lib/js/jquery.stickytableheaders.min.js'></script>
<script type='text/javascript' src='https://fniessen.github.io/org-html-themes/org/readtheorg/js/readtheorg.js'></script>
<style>
pre.src {
background-color: var(--theme-bg);
color: var(--theme-fg);
scrollbar-color:#bbb6#9992;
scrollbar-width: thin;
margin: 0;
border: none;
}
div.org-src-container {
border-radius: 12px;
overflow: hidden;
margin-bottom: 24px;
margin-top: 1px;
border: 1px solid#e1e4e5;
}
pre.src::before {
background-color:#6666;
top: 8px;
border: none;
border-radius: 5px;
line-height: 1;
border: 2px solid var(--theme-bg);
opacity: 0;
transition: opacity 200ms;
}
pre.src:hover::before { opacity: 1; }
pre.src:active::before { opacity: 0; }
pre.example {
border-radius: 12px;
background: var(--theme-bg-alt);
color: var(--theme-fg);
}
code {
border-radius: 5px;
background:#e8e8e8;
font-size: 80%;
}
kbd {
display: inline-block;
padding: 3px 5px;
font: 80% SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;
line-height: normal;
line-height: 10px;
color:#444d56;
vertical-align: middle;
background-color:#fafbfc;
border: 1px solid#d1d5da;
border-radius: 3px;
box-shadow: inset 0 -1px 0#d1d5da;
}
table {
max-width: 100%;
overflow-x: auto;
display: block;
border-top: none;
}
a {
text-decoration: none;
background-image: linear-gradient(#d8dce9, #d8dce9);
background-position: 0% 100%;
background-repeat: no-repeat;
background-size: 0% 2px;
transition: background-size .3s;
}
\#table-of-contents a {
background-image: none;
}
a:hover, a:focus {
background-size: 100% 2px;
}
a[href^='#'] { font-variant-numeric: oldstyle-nums; }
a[href^='#']:visited { color:#3091d1; }
li .checkbox {
display: inline-block;
width: 0.9em;
height: 0.9em;
border-radius: 3px;
margin: 3px;
top: 4px;
position: relative;
}
li.on > .checkbox { background: var(--theme-green); box-shadow: 0 0 2px var(--theme-green); }
li.trans > .checkbox { background: var(--theme-orange); box-shadow: 0 0 2px var(--theme-orange); }
li.off > .checkbox { background: var(--theme-red); box-shadow: 0 0 2px var(--theme-red); }
li.on > .checkbox::after {
content: '';
height: 0.45em;
width: 0.225em;
-webkit-transform-origin: left top;
transform-origin: left top;
transform: scaleX(-1) rotate(135deg);
border-right: 2.8px solid#fff;
border-top: 2.8px solid#fff;
opacity: 0.9;
left: 0.10em;
top: 0.45em;
position: absolute;
}
li.trans > .checkbox::after {
content: '';
font-weight: bold;
font-size: 1.6em;
position: absolute;
top: 0.23em;
left: 0.09em;
width: 0.35em;
height: 0.12em;
background:#fff;
opacity: 0.9;
border-radius: 0.1em;
}
li.off > .checkbox::after {
content: '✖';
color:#fff;
opacity: 0.9;
position: relative;
top: -0.40rem;
left: 0.17em;
font-size: 0.75em;
}
span.timestamp {
color: #003280;
background: #647CFF44;
border-radius: 3px;
line-height: 1.25;
}
\#table-of-contents { overflow-y: auto; }
blockquote p { margin: 8px 0px 16px 0px; }
\#postamble .date { color: var(--theme-green); }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background:#9992; }
::-webkit-scrollbar-thumb { background:#ccc; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background:#888; }
</style>
<!––tec/custom-head-end-->
"
))))
(add-hook 'org-export-before-processing-hook 'jsravn--org-inline-css-hook)
;; Exporting to HTML:1 ends here
;; [[file:config.org::*Exporting to HTML][Exporting to HTML:2]]
(setq org-html-text-markup-alist
'((bold . "<b>%s</b>")
(code . "<code>%s</code>")
(italic . "<i>%s</i>")
(strike-through . "<del>%s</del>")
(underline . "<span class=\"underline\">%s</span>")
(verbatim . "<kbd>%s</kbd>")))
;; Exporting to HTML:2 ends here
;; [[file:config.org::*Exporting to HTML][Exporting to HTML:3]]
;; (after! org
;; (appendq! org-html-checkbox-types
;; '((html-span .
;; ((on . "<span class='checkbox'></span>")
;; (off . "<span class='checkbox'></span>")
;; (trans . "<span class='checkbox'></span>")))))
;; (setq org-html-checkbox-type 'html-span))
;; Exporting to HTML:3 ends here
;; [[file:config.org::*Exporting to Beamer][Exporting to Beamer:1]]
(setq org-beamer-theme "[progressbar=foot]metropolis")
;; Exporting to Beamer:1 ends here
;; [[file:config.org::*Exporting to Beamer][Exporting to Beamer:2]]
(setq org-beamer-frame-level 2)
;; Exporting to Beamer:2 ends here
;; [[file:config.org::*Exporting to GFM][Exporting to GFM:1]]
(eval-after-load "org"
'(require 'ox-gfm nil t))
;; Exporting to GFM:1 ends here
;; [[file:config.org::*Capture templates][Capture templates:1]]
(after! org
(setq org-capture-templates
`(("t" "Todo [inbox]" entry
(file ,(concat org-directory "inbox.org"))
"* TODO %i%?")
("e" "Event [inbox]" entry
(file ,(concat org-directory "inbox.org"))
"* %i%? \n %U")
("n" "Note [inbox]" entry
(file ,(concat org-directory "inbox.org"))
"* %?")
("s" "Shopping [todo]" checkitem
(file+olp ,(concat org-directory "someday.org") "Shopping")
"- [ ] %?"))))
;; Capture templates:1 ends here
;; [[file:config.org::*Task settings][Task settings:1]]
(after! org
(setq
org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)"))
org-log-done 'time))
;; Task settings:1 ends here
;; [[file:config.org::*Contexts][Contexts:1]]
(after! org
(setq
org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("@omscs" . ?o))
org-fast-tag-selection-single-key t))
;; Contexts:1 ends here
;; [[file:config.org::*Refile targets][Refile targets:1]]
(after! org
(setq
org-refile-targets '(("~/Notes/todo.org" :maxlevel . 2)
("~/Notes/someday.org" :maxlevel . 2)
("~/Notes/tickler.org" :maxlevel . 2)
("~/Notes/notes.org" :maxlevel . 2))))
;; Refile targets:1 ends here
;; [[file:config.org::*Habits][Habits:1]]
(after! org
(add-to-list 'org-modules 'org-habit t))
;; Habits:1 ends here
;; [[file:config.org::*Custom Agendas][Custom Agendas:1]]
(after! org
(setq org-agenda-custom-commands
(list (jsravn--all-agenda)
(jsravn--agenda "home")
(jsravn--agenda "work")
(jsravn--agenda "omscs"))))
;; Custom Agendas:1 ends here
;; [[file:config.org::*Custom Agendas][Custom Agendas:2]]
(after! org (setq org-deadline-warning-days 14))
;; Custom Agendas:2 ends here
;; [[file:config.org::*All Agenda Function][All Agenda Function:1]]
(defun jsravn--all-agenda ()
"Custom all agenda."
`("A" "All agenda"
((todo "" ((org-agenda-files '("~/Notes/inbox.org" "~/Notes/roam/inbox.org"))
(org-agenda-overriding-header "Inbox")))
(tags "-{.*}" ((org-agenda-files '("~/Notes/todo.org"
"~/Notes/tickler.org"
"~/Notes/someday.org"))
(org-agenda-overriding-header "Untagged")))
(agenda "" ((org-agenda-span 7)
(org-agenda-start-day "-1d")
(org-agenda-files '("~/Notes/tickler.org"
"~/Notes/todo.org"))
(org-agenda-skip-function #'jsravn--skip-scheduled-if-in-todo)))
,(jsravn--tags-todo "@home" "Home")
,(jsravn--tags-todo "@work" "Work")
,(jsravn--tags-todo "@omscs" "OMSCS"))))
;; All Agenda Function:1 ends here
;; [[file:config.org::*Context Agenda Function][Context Agenda Function:1]]
(defun jsravn--agenda (scope)
"Custom scoped agenda."
(let ((key (substring scope 0 1))
(title (concat (upcase-initials scope) "agenda"))
(tag (concat "@" scope)))
`(,key ,title
((agenda "" ((org-agenda-span 7)
(org-agenda-start-day "-1d")
(org-agenda-files '("~/Notes/tickler.org"
"~/Notes/todo.org"))
(org-agenda-skip-function #'jsravn--skip-scheduled-if-in-todo)))
,(jsravn--tags-todo (concat tag "/!TODO") "Todo")
,(jsravn--tags-todo (concat tag "/!WAITING") "Waiting"))
((org-agenda-tag-filter-preset '(,(concat "+" tag)))))))
;; Context Agenda Function:1 ends here
;; [[file:config.org::*Agenda Support Functions][Agenda Support Functions:1]]
(defun jsravn--tags-todo (tags header)
"Customized tags-todo view which only shows the first TODO in a subheading."
`(tags-todo ,tags ((org-agenda-files '("~/Notes/todo.org"))
(org-agenda-overriding-header ,header)
(org-agenda-skip-function #'jsravn--skip-all-siblings-but-first))))
(defun jsravn--skip-all-siblings-but-first ()
"Skip all but the first non-done entry that is inside a subheading."
(when (> (car (org-heading-components)) 2)
(let (should-skip-entry)
(save-excursion
(while (and (not should-skip-entry) (org-goto-sibling t))
(when (string= "TODO" (org-get-todo-state))
(setq should-skip-entry t))))
(when should-skip-entry
(or (outline-next-heading) (goto-char (point-max)))))))
;; Agenda Support Functions:1 ends here
;; [[file:config.org::*Agenda Support Functions][Agenda Support Functions:2]]
(defun jsravn--skip-scheduled-if-in-todo ()
"Skip scheduled items that have been moved to todo.org."
(when (and (string= "todo.org" (file-name-nondirectory (buffer-file-name)))
(org-entry-get nil "SCHEDULED"))
(or (outline-next-heading) (goto-char (point-max)))))
;; Agenda Support Functions:2 ends here
;; [[file:config.org::*Agenda Searches][Agenda Searches:1]]
(after! org (setq org-agenda-text-search-extra-files '(agenda-archives)))
;; Agenda Searches:1 ends here
;; [[file:config.org::*Agenda Searches][Agenda Searches:2]]
(after! org (setq org-agenda-search-view-always-boolean t))
;; Agenda Searches:2 ends here
;; [[file:config.org::*org-roam][org-roam:1]]
(setq org-roam-directory (concat org-directory "roam/"))
;; org-roam:1 ends here
;; [[file:config.org::*org-roam][org-roam:2]]
(setq org-roam-capture-templates
'(("d" "default" plain (function org-roam-capture--get-point)
"%?"
:file-name "${slug}"
:head "#+TITLE: ${title}\n"
:unnarrowed t)))
;; org-roam:2 ends here
;; [[file:config.org::*org-roam][org-roam:3]]
(setq deft-directory org-roam-directory)
;; org-roam:3 ends here
;; [[file:config.org::*org-roam][org-roam:4]]
(setq org-roam-buffer-no-delete-other-windows t)
;; org-roam:4 ends here
;; [[file:config.org::*org-roam][org-roam:5]]
(defun jsravn--open-org-roam ()
"Called by `org-mode-hook' to call `org-roam' if the current buffer is a roam file."
(remove-hook 'window-configuration-change-hook #'jsravn--open-org-roam)
(when (org-roam--org-roam-file-p)
(unless (eq 'visible (org-roam--current-visibility)) (org-roam))))
(after! org-roam
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'window-configuration-change-hook #'jsravn--open-org-roam))))
;; org-roam:5 ends here
;; [[file:config.org::*org-journal][org-journal:1]]
(setq org-journal-date-prefix "#+TITLE: "
org-journal-date-format "%A, %d %B %Y"
org-journal-file-format "%Y-%m-%d.org"
org-journal-time-prefix "* "
org-journal-dir org-roam-directory)
;; org-journal:1 ends here
;; [[file:config.org::*YAML][YAML:1]]
(setq lsp-yaml-schemas (make-hash-table))
(puthash "kubernetes" ["resources.yaml"
"resources/*"
"pod.yaml"
"deployment.yaml"
"serviceaccount.yaml"
"clusterrole.yaml"
"role.yaml"
"clusterrolebinding.yaml"
"rolebinding.yaml"
"configmap.yaml"
"service.yaml"]
lsp-yaml-schemas)
(puthash "http://json.schemastore.org/kustomization" ["kustomization.yaml"] lsp-yaml-schemas)
;; YAML:1 ends here
;; [[file:config.org::*cuda][cuda:1]]
(add-hook! cuda-mode (run-hooks 'prog-mode-hook))
;; cuda:1 ends here
;; [[file:config.org::*cc][cc:1]]
(setq-hook! 'c-mode-hook tab-width 2)
;; cc:1 ends here