-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.el
2161 lines (1801 loc) · 81.7 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
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; 정말 설정 변경할 만한 녀석들만 짧게 넣어야 한다
;; 나머지는 모듈이나 사용자 설정으로 다 빼놔야 혼란이 적고 손댈일이 없다.
;; Check for missing external software
;;
;; - soffice (LibreOffice): View and create office documents
;; - zip: Unpack ePub documents
;; - pdftotext (poppler-utils): Convert PDF to text
;; - djvu (DjVuLibre): View DjVu files
;; - curl: Reading RSS feeds
;; - divpng: Part of LaTeX
;; - dot (GraphViz): Create note network diagrams
;; - convert (ImageMagick): Convert image files
;; - gm (GraphicsMagick): Convert image files
;; - latex (TexLive, MacTex or MikTeX): Preview LaTex and export Org to PDF
;; - hunspell: Spellcheck. Also requires a hunspell dictionary
;; - grep: Search inside files
;; - ripgrep: Faster alternative for grep
;; - gs (GhostScript): View PDF files
;; - mutool (MuPDF): View PDF files
;; - mpg321, ogg123 (vorbis-tools), mplayer, mpv, vlc: Media players
;;; Commentary:
;; ❶ :: U+2776 ==> 더원싱 태그로 활용
;; ㉽ :: U+327D
;; ㉼ :: U+327C
;;; Load 'Per-Machine' - User Configs
;; Most of my per-environment config done via =customize= and is in .custom.el.
;; However, some config is more involved, such as packages I just want in one
;; environment and not the others. To that end, let's load a file that can contain
;; those customizations.
(let ((per-machine-filename (concat user-dotemacs-dir "per-machine.el")))
(when (file-exists-p per-machine-filename)
(load-file per-machine-filename)))
;;; Load 'user-keys'
(let ((user-keys-filename (concat user-dotemacs-dir "user-keys.el")))
(when (file-exists-p user-keys-filename)
(load-file user-keys-filename)))
;;; Load 'user-configs'
(load! "+user-configs")
;;; :lang org
;;;; org reloading
(after! org
(message "after org - config")
(require 'org-funcs)
(require 'org-config)
;; (load-file (concat user-dotemacs-dir "lisp/org-funcs.el"))
;; (load-file (concat user-dotemacs-dir "lisp/org-config.el"))
(setq org-id-locations-file (file-name-concat org-directory (concat "." system-name "-orgids"))) ; ".org-id-locations"))
;; (+org-init-keybinds-h) -> 2024-06-01 여기 키바인딩 관련 부분 뒤에서 다시 잡아줌
;; (setq org-attach-use-inheritance nil) ; selective
;; overide here! important
(setq org-insert-heading-respect-content nil) ; doom t
;; (progn
;; ;; 2024-06-04 file - id - http/https
;; (org-link-set-parameters "file" :face `(:inherit link :weight semibold :slant italic :underline t)) ;; italic
;; (org-link-set-parameters "http" :face `(:inherit warning :weight semibold :underline t))
;; (org-link-set-parameters "info" :face `(:inherit info-file :weight semibold :underline t))
;; (org-link-set-parameters "https" :face `(:inherit warning :weight semibold :underline t))
;; )
(org-link-set-parameters "denote" :face `(:inherit success :weight semibold :underline t)) ; id
;; 2024-06-24 performance issue
;; (remove-hook 'org-mode-hook 'org-eldoc-load)
;; 2024-09-15 TODO
;; (progn
;; ;; Those advice were designed when using a bottom modeline. Since we are using
;; ;; a header line, we must remove them.
;; (advice-remove 'org-fast-tag-selection #'+popup--org-fix-popup-window-shrinking-a)
;; (advice-remove 'org-fast-todo-selection #'+popup--org-fix-popup-window-shrinking-a)
;; ;; (defadvice! +popup--suppress-delete-other-windows-a (fn &rest args)
;; ;; Courtesy: doom emacs (popup/+hacks.el)
;; (defun +popup--supress-delete-other-windows-a (origin-fn &rest args)
;; (if +popup-mode
;; (cl-letf (((symbol-function #'delete-other-windows) #'ignore)
;; ((symbol-function #'delete-window) #'ignore))
;; (apply origin-fn args))
;; (apply origin-fn args)))
;; (advice-add #'org-fast-tag-selection :around #'+popup--supress-delete-other-windows-a)
;; (advice-add #'org-fast-todo-selection :around #'+popup--supress-delete-other-windows-a)
;; )
)
;;;; TODO org-src-mode-map
;; (with-eval-after-load 'org-src
;; ;; "c" 'org-edit-src-exit
;; ;; "a" 'org-edit-src-abort
;; ;; "k" 'org-edit-src-abort
;; C-c C-c geiser-eval-definition
;; ;; I prefer C-c C-c over C-c ' (more consistent)
;; (define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
;; )
;;;; org-capture templates
;;;;; org-contacts
(after! org
(require 'org-contacts)
(add-to-list
'org-capture-templates
`("c" "Contacts" entry (file ,(my/org-contacts-file))
"* %(org-contacts-template-name)\n:PROPERTIES:\n:GITHUB:\n:EMAIL: [email protected]\n:URL:\n:NOTE:\n:END:\n%U\n%T\n%a\n")) ;; :CUSTOM_ID: %(prot-org--id-get)\n
)
;;;;; org-bookmarks
(after! org
(require 'org-bookmarks)
(add-to-list 'org-capture-templates
`("b" ,(format "%s\tAdd a new bookmark to %s"
(when (fboundp 'nerd-icons-mdicon)
(nerd-icons-mdicon
"nf-md-bookmark_plus_outline"
:face 'nerd-icons-blue))
(file-name-nondirectory org-bookmarks-file))
entry (file ,(expand-file-name org-bookmarks-file))
,(concat
"* %^{bookmark title}\t\t\t\t"
(format ":%s:" org-bookmarks-tag)
"
:PROPERTIES:
:URL: %^C
:DATE: %t
:END:")
:empty-lines 1
:jump-to-captured t
:refile-targets ((,org-bookmarks-file :maxlevel 3)))
:append))
;;;; org-journal
;; (require 'side-journal)
(progn
(require 'org-journal)
(defun my-old-carryover (old_carryover)
(save-excursion
(let ((matcher (cdr (org-make-tags-matcher org-journal-carryover-items))))
(dolist (entry (reverse old_carryover))
(save-restriction
(narrow-to-region (car entry) (cadr entry))
(goto-char (point-min))
(org-scan-tags '(lambda ()
(org-todo "DONT")
(org-set-tags ":ARCHIVE:"))
matcher org--matcher-tags-todo-only))))))
(setq org-journal-carryover-items "TODO=\"TODO\"|TODO=\"NEXT\"")
(setq org-journal-handle-old-carryover-fn 'my-old-carryover)
(setq org-journal-dir (concat user-org-directory "journal"))
(setq org-journal-file-format "%Y%m%dT000000--%Y-%m-%d__journal_week%W.org")
(setq org-journal-date-format "%Y-%m-%d %a") ; Week%W:
;; (setq org-journal-date-prefix "#+title: ")
;; (setq org-journal-time-prefix "** ") ; default **
;; (setq org-journal-time-format "%R ") ; "[%<%Y-%m-%d %a %H:%M>]" ; default "%R "
(setq org-journal-enable-agenda-integration t) ; default nil
(setq org-journal-file-type 'weekly) ; default 'daily
(setq org-journal-tag-alist '(("meet" . ?m) ("dev" . ?d) ("idea" . ?i) ("emacs" . ?e) ("discuss" . ?c) ("1on1" . ?o))) ; default nil
)
;;;; TODO om-dash org-based dashboards
;; [cite:@gavvomdash24] Building blocks for org-based dashboards.
;; (use-package! om-dash
;; :defer 5
;; :config
;; (require 'parse-csv)
;; )
;;; :ui
;;;; jit-lock-defer-time
;; NOTE: setting this to `0' like it was recommended in the article above seems
;; to cause fontification to happen in real time, which can be pretty slow in
;; large buffers. Giving it a delay seems to be better.
;; (setq jit-lock-defer-time 0.05) ;; better
;; (setq jit-lock-defer-time 0) ; important
;; My guess for how big this number should be for my setup. Call
;; `cae-set-jit-lock-chunk-size-to-optimal' on a few different files to get an
;; idea.
;; (setq jit-lock-chunk-size 2500) ; default 1500
;;;; savehist-auto-save-interval
(setq savehist-autosave-interval 300)
;;;; custom diff-hl
(use-package! diff-hl
:config
(setq diff-hl-disable-on-remote t) ; default nil
(setq diff-hl-flydiff-delay 0.8) ; doom 0.5, default: 0.3
;; (remove-hook 'diff-hl-mode-hook #'diff-hl-flydiff-mode)
;; (remove-hook 'diff-hl-flydiff-mode-hook #'+vc-gutter-init-flydiff-mode-h)
)
;;;; modus-themes
(use-package! modus-themes
:commands (modus-themes-toggle)
:init
(setq modus-themes-to-toggle
(let ((hr (nth 2 (decode-time))))
(if (or (< hr 6) (< 19 hr)) ; between 8 PM and 7 AM
'(modus-vivendi-tinted modus-operandi) ; load dark theme first
'(modus-operandi modus-vivendi-tinted))))
:config
(setq modus-themes-italic-constructs nil
modus-themes-bold-constructs t
modus-themes-custom-auto-reload t
;; Options for `modus-themes-prompts' are either nil (the
;; default), or a list of properties that may include any of those
;; symbols: `italic', `WEIGHT'
;; modus-themes-prompts '(bold)
;; The `modus-themes-completions' is an alist that reads two
;; keys: `matches', `selection'. Each accepts a nil value (or
;; empty list) or a list of properties that can include any of
;; the following (for WEIGHT read further below):
;; `matches' :: `underline', `italic', `WEIGHT'
;; `selection' :: `underline', `italic', `WEIGHT'
;; modus-themes-completions
;; '((matches . (semibold))
;; (selection . (semibold text-also)))
;; modus-themes-common-palette-overrides
;; `((fg-mode-line-active fg-main) ; Black
;; ;; Comments are yellow, strings are green
;; (comment yellow-cooler)
;; (string green-warmer)
;; ;; "Make the mode line borderless"
;; (border-mode-line-active unspecified)
;; (border-mode-line-inactive unspecified)
;; ;; "Make matching parenthesis more or less intense"
;; (bg-paren-match bg-magenta-intense)
;; (underline-paren-match unspecified)
;; ;; Intense magenta background combined with the main foreground
;; ;; (bg-region bg-magenta-subtle)
;; ;; (fg-region fg-main)
;; ;; Links
;; ;; (underline-link border)
;; ;; (underline-link-visited border)
;; ;; (underline-link-symbolic border)
;; (bg-heading-0 bg-green-subtle) ; green
;; ;; (bg-heading-1 bg-dim)
;; ;; (bg-heading-2 bg-yellow-nuanced)
;; ;; (bg-heading-3 bg-blue-nuanced) ; blue
;; ;; copy from intense
;; (overline-heading-0 unspecified)
;; (overline-heading-1 magenta-cooler)
;; (overline-heading-2 magenta-warmer)
;; ;; And expand the preset here. Note that the ,@ works because we use
;; ;; the backtick for this list, instead of a straight quote.
;; ;; ,@modus-themes-preset-overrides-faint
;; ;; ,@modus-themes-preset-overrides-intense
;; )
)
(when (display-graphic-p) ; gui
(setq modus-themes-variable-pitch-ui t)
;; The `modus-themes-headings' is an alist: read the manual's
;; node about it or its doc string. Basically, it supports
;; per-level configurations for the optional use of
;; `variable-pitch' typography, a height value as a multiple of
;; the base font size (e.g. 1.5), and a `WEIGHT'.
(setq modus-themes-headings
'(
(0 . (bold 1.2)) ;; variable-pitch
(1 . (bold 1.1))
(2 . (semibold 1.0))
(3 . (semibold 1.0))
(4 . (medium 1.0))
(5 . (medium 1.0))
(6 . (medium 1.0))
(7 . (medium 1.0))
(agenda-date . (semibold 1.0))
(agenda-structure . (bold 1.1))
(t . (medium 1.0)))
)
)
(defun my/modus-themes-custom-faces ()
(interactive)
;; (message "modus-themes-after-hook : my-modus-themes-custom-faces")
(modus-themes-with-colors
(custom-set-faces
`(consult-separator ((,c :inherit default :foreground ,yellow-intense)))
`(consult-notes-time ((,c :inherit default :foreground ,cyan-intense)))
;; `(ekg-notes-mode-title ((,c :inherit outline-1 :weight bold :height 1.0)))
;; `(ekg-title ((,c :inherit outline-2 :weight semibold :height 1.0 :underline t)))
;; `(ekg-tag ((,c :background ,bg-yellow-nuanced :box (:line-width 1 :color ,fg-dim) :foreground ,fg-main :style nil))) ; prose-tag
;; `(ekg-resource ((,c :inherit outline-7 :weight regular :height 1.0 :underline t)))
;; `(ekg-metadata ((,c :inherit outline-1 :weight regular :height 1.0)))
`(org-list-dt ((,c :foreground ,fg-main :weight bold))) ;; 2025-01-14
;; `(org-tag ((,c :background ,bg-yellow-nuanced :box (:line-width 1 :color ,fg-dim) :foreground ,fg-main :style nil))) ; prose-tag
`(diredp-file-name ((,c :foreground ,fg-main)))
;; `(diredp-dir-name ((,c :inherit dired-directory)))
;; `(diredp-ignored-file-name ((,c :inherit shadow)))
;; `(diredp-compressed-file-suffix ((,c :foreground ,err)))
;; `(diredp-symlink ((,c :inherit dired-symlink)))
;; `(diredp-dir-heading ((,c :inherit bold)))
;; `(diredp-file-suffix ((,c :foreground ,variable)))
;; `(diredp-date-time ((,c :foreground ,date-common)))
;; `(diredp-no-priv ((,c :inherit shadow)))
;; `(diredp-number ((,c :inherit shadow)))
;; `(diredp-dir-priv ((,c :inherit dired-directory)))
;; `(diredp-exec-priv ((,c :foreground ,accent-1)))
;; `(diredp-write-priv ((,c :foreground ,accent-0)))
;; `(diredp-rare-priv ((,c :foreground ,accent-3)))
;; `(diredp-read-priv ((,c :foreground ,fg-main)))
;; `(diredp-link-priv ((,c :foreground ,fg-link)))
;; `(diredp-other-priv ((,c :foreground ,accent-2)))
;; `(diredp-autofile-name ((,c :background ,bg-inactive)))
;; `(diredp-compressed-file-name ((,c :foreground ,warning)))
;; `(diredp-deletion ((,c :inherit dired-flagged)))
;; `(diredp-deletion-file-name ((,c :inherit diredp-deletion)))
;; `(diredp-executable-tag ((,c :inherit diredp-exec-priv)))
;; `(diredp-flag-mark ((,c :inherit dired-marked)))
;; `(diredp-flag-mark-line ((,c :inherit dired-marked)))
;; `(diredp-tagged-autofile-name ((,c :inherit (diredp-autofile-name dired-marked))))
;; `(org-agenda-diary ((,c :inherit org-agenda-calendar-sexp :foreground ,fg-main :weight semibold)))
;; `(org-link ((,c :inherit link :weight bold)))
;; `(denote-faces-link ((,c :inherit link :weight bold :slant italic)))
;; `(org-drawer ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-metadata :height 0.8)))
;; `(org-special-keyword ((,c :inherit modus-themes-fixed-pitch :foreground ,prose-metadata)))
;; 2024-07-03 spacious-padding
`(tab-bar ((,c :background ,bg-tab-bar)))
`(tab-bar-tab-group-current ((,c :inherit bold :background ,bg-tab-current :box (:line-width -2 :color ,bg-tab-current) :foreground ,fg-alt)))
`(tab-bar-tab-group-inactive ((,c :background ,bg-tab-bar :box (:line-width -2 :color ,bg-tab-bar) :foreground ,fg-alt)))
`(tab-bar-tab ((,c :inherit bold :box (:line-width -2 :color ,bg-tab-current) :background ,bg-tab-current)))
`(tab-bar-tab-inactive ((,c :box (:line-width -2 :color ,bg-tab-other) :background ,bg-tab-other)))
`(tab-bar-tab-ungrouped ((,c :inherit tab-bar-tab-inactive)))
`(fringe ((,c :background ,bg-dim)))
`(vterm-color-black ((,c :background "gray25" :foreground "gray25")))
`(vterm-color-yellow ((,c :background ,yellow-intense :foreground ,yellow-intense)))
`(org-mode-line-clock ((,c :inherit bold :foreground ,modeline-info)))
`(org-mode-line-clock-overrun ((,c :inherit bold :foreground ,modeline-err)))
`(jinx-misspelled ((,c :underline (:style wave :color ,magenta-cooler))))
;; `(ten-id-face ((,c :inherit font-lock-keyword-face :underline (:style double-line :color ,cyan))))
;; `(keycast-command ((,c :inherit default :height 0.9)))
)
)
(when (display-graphic-p) ; gui
(when (locate-library "spacious-padding")
(spacious-padding-mode +1)))
)
(add-hook 'modus-themes-post-load-hook #'my/modus-themes-custom-faces)
) ;; end-of use-package
;;;; ef-themes
(use-package! ef-themes
:defer t
:init
(setq ef-themes-to-toggle
(let ((hr (nth 2 (decode-time))))
(if (or (< hr 6) (< 19 hr)) ; between 7 PM and 6 AM
'(ef-owl ef-eagle) ; load dark theme first
'(ef-eagle ef-owl))))
(defun ef-themes-load-random-light ()
(interactive) (ef-themes-load-random 'light))
(defun ef-themes-load-random-dark ()
(interactive) (ef-themes-load-random 'dark))
:config
(setq ef-themes-light-themes
'(
ef-maris-light ; blue
ef-eagle ; yellow
ef-kassio ; pink
ef-frost ; green
ef-reverie
))
(setq ef-themes-dark-themes
'(
ef-melissa-dark ;; Like solarized but much nicer colors.
ef-dream ; 보라 - 드라큘라
ef-rosa ; 자주
ef-maris-dark
ef-elea-dark
ef-owl ; 2024-08-19 new
))
;; Read the doc string or manual for this one. The symbols can be
;; combined in any order.
(setq ef-themes-region '(intense no-extend neutral))
(when (display-graphic-p) ; gui
(setq ef-themes-variable-pitch-ui t))
(defun my/ef-themes-custom-faces ()
"Configure `hl-todo-keyword-faces' with Ef themes colors.
The exact color values are taken from the active Ef theme."
(interactive)
;; (message "ef-themes-post-load-hook : my-ef-themes-custom-faces")
(ef-themes-with-colors
(custom-set-faces
`(consult-separator ((,c :inherit default :foreground ,yellow)))
`(consult-notes-time ((,c :inherit default :foreground ,cyan)))
;; `(ekg-notes-mode-title ((,c :inherit outline-1 :weight bold :height 1.0)))
;; `(ekg-title ((,c :inherit outline-2 :weight semibold :height 1.0 :underline t)))
;; `(ekg-tag ((,c :background ,bg-yellow-subtle :box (:line-width 1 :color ,fg-dim) :foreground ,fg-main :style nil))) ; prose-tag
;; `(ekg-resource ((,c :inherit outline-7 :weight regular :height 1.0 :underline t)))
;; `(ekg-metadata ((,c :inherit outline-1 :weight regular :height 1.0)))
;; `(org-link ((,c :inherit link :weight bold)))
;; `(denote-faces-link ((,c :inherit link :weight bold :slant italic)))
;; `(org-agenda-diary ((,c :inherit org-agenda-calendar-sexp :foreground ,fg-main :weight semibold)))
`(org-list-dt ((,c :foreground ,fg-main :weight bold))) ;; 2025-01-14
;; `(org-tag ((,c :background ,bg-yellow-subtle :box (:line-width 1 :color ,fg-dim) :foreground ,fg-main :style nil))) ; prose-tag
`(diredp-file-name ((,c :foreground ,fg-main)))
`(tab-bar ((,c :background ,bg-tab-bar)))
`(tab-bar-tab-group-current ((,c :inherit bold :background ,bg-tab-current :box (:line-width -2 :color ,bg-tab-current) :foreground ,fg-alt)))
`(tab-bar-tab-group-inactive ((,c :background ,bg-tab-bar :box (:line-width -2 :color ,bg-tab-bar) :foreground ,fg-alt)))
`(tab-bar-tab ((,c :inherit bold :box (:line-width -2 :color ,bg-tab-current) :background ,bg-tab-current)))
`(tab-bar-tab-inactive ((,c :box (:line-width -2 :color ,bg-tab-other) :background ,bg-tab-other)))
`(tab-bar-tab-ungrouped ((,c :inherit tab-bar-tab-inactive)))
;; `(keycast-command ((,c :inherit ef-themes-ui-variable-pitch :background ,bg-main :foreground ,fg-main :weight semibold)))
;; `(keycast-command ((,c :inherit default :height 0.9)))
`(fringe ((,c :background ,bg-dim)))
`(org-mode-line-clock ((,c :inherit bold :foreground ,modeline-info)))
`(org-mode-line-clock-overrun ((,c :inherit bold :foreground ,modeline-err)))
`(jinx-misspelled ((,c :underline (:style wave :color ,magenta-cooler))))
;; `(ten-id-face ((,c :inherit font-lock-keyword-face :underline (:style double-line :color ,cyan))))
)
(setq hl-todo-keyword-faces
`(("HOLD" . ,yellow)
("TODO" . ,red)
("NEXT" . ,blue)
("THEM" . ,magenta)
("PROG" . ,cyan-warmer)
("OKAY" . ,green-warmer)
("DONT" . ,yellow-warmer)
("FAIL" . ,red-warmer)
("BUG" . ,red-warmer)
("DONE" . ,green)
("NOTE" . ,blue-warmer)
("KLUDGE" . ,cyan)
("HACK" . ,cyan)
("TEMP" . ,red)
("FIXME" . ,red-warmer)
("XXX+" . ,red-warmer)
("REVIEW" . ,red)
("DEPRECATED" . ,yellow))))
(when (display-graphic-p) ; gui
(when (locate-library "spacious-padding")
(spacious-padding-mode +1)))
;; (setq ring-bell-function 'jf/pulse)
)
(add-hook 'ef-themes-post-load-hook #'my/ef-themes-custom-faces))
;;;; DONT my-themes for doom-themes
;; (require 'my-themes)
;; (add-hook 'doom-load-theme-hook 'my/load-custom-set-faces 90) ; for doom themes
;;;; spacious-padding
(use-package! spacious-padding
:if window-system ; important
:hook (server-after-make-frame . spacious-padding-mode)
:init
;; Read the doc string of `spacious-padding-subtle-mode-line' as it is very flexible.
(setq spacious-padding-subtle-mode-line
'( :mode-line-active spacious-padding-subtle-mode-line-active
:mode-line-inactive spacious-padding-subtle-mode-line-inactive))
(setq spacious-padding-widths
'(:header-line-width 4
:mode-line-width 4 ; 6
:tab-width 4 ; sync mode-line-width for keycast-tab-bar
:internal-border-width 20 ; 15
:right-divider-width 30 ; 30
:scroll-bar-width 8
:fringe-width 8
))
(add-hook 'doom-load-theme-hook #'spacious-padding-mode)
:config
;; (remove-hook 'doom-init-ui-hook #'window-divider-mode)
;; (blink-cursor-mode t)
;; (when (fboundp 'tooltip-mode) (tooltip-mode 1))
;; (when (fboundp 'tool-bar-mode) (tool-bar-mode 1))
;; (when (display-graphic-p) ; gui
;; (menu-bar-mode +1))
(spacious-padding-mode +1)
)
;;;; list-unicode-display
(use-package! list-unicode-display :defer t)
;;;; DONT pulse : built-in - visual feedback
;; (progn
;; ;; add visual pulse when changing focus, like beacon but built-in
;; ;; from from https://karthinks.com/software/batteries-included-with-emacs/
;; (require 'pulse)
;; (defun pulse-line (&rest _)
;; "Pulse the current line."
;; (pulse-momentary-highlight-one-line (point)))
;; (dolist (command
;; '(scroll-up-command scroll-down-command recenter-top-bottom other-window))
;; (advice-add command :after #'pulse-line))
;; )
;;;; DONT pulsar - performance issue
;; LionyxML-lemacs/lemacs-init.org
;; The `pulsar' package enhances the user experience in Emacs by providing
;; visual feedback through pulsating highlights. This feature is especially
;; useful in programming modes, where it can help users easily track
;; actions such as scrolling, error navigation, yanking, deleting, and
;; jumping to definitions.
;; (use-package! pulsar
;; :hook (doom-first-input . pulsar-global-mode)
;; :config
;; (progn
;; (setq pulsar-pulse t)
;; (setq pulsar-delay 0.025)
;; (setq pulsar-iterations 10)
;; ;; (setq pulsar-face 'evil-ex-lazy-highlight)
;; (setq pulsar-face 'pulsar-magenta)
;; ;; (setq pulsar-highlight-face 'pulsar-yellow)
;; ;; reset
;; (setq pulsar-pulse-functions nil)
;; (dolist
;; (built-in-function
;; '(recenter-top-bottom
;; move-to-window-line-top-bottom
;; reposition-window bookmark-jump other-window
;; delete-window delete-other-windows
;; forward-page backward-page scroll-up-command
;; scroll-down-command tab-new tab-close tab-next
;; org-next-visible-heading
;; org-previous-visible-heading
;; org-forward-heading-same-level
;; org-backward-heading-same-level
;; outline-backward-same-level
;; outline-forward-same-level
;; outline-next-visible-heading
;; outline-previous-visible-heading
;; outline-up-heading))
;; (add-to-list 'pulsar-pulse-functions built-in-function))
;; (when (fboundp 'winner-undo)
;; (add-to-list 'pulsar-pulse-functions 'winner-undo)
;; (add-to-list 'pulsar-pulse-functions 'winner-redo))
;; (when (fboundp 'winum-select-window-1)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-1)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-2)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-3)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-4)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-5)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-6)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-7)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-8)
;; (add-to-list 'pulsar-pulse-functions 'winum-select-window-9))
;; (when (fboundp 'evil-window-right)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-right)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-left)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-up)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-next)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-prev)
;; (add-to-list 'pulsar-pulse-functions 'evil-window-down))
;; (add-to-list 'pulsar-pulse-functions 'evil-scroll-down)
;; (add-to-list 'pulsar-pulse-functions 'flymake-goto-next-error)
;; (add-to-list 'pulsar-pulse-functions 'flymake-goto-prev-error)
;; (add-to-list 'pulsar-pulse-functions 'flycheck-next-error)
;; (add-to-list 'pulsar-pulse-functions 'flycheck-previous-error)
;; ;; (add-to-list 'pulsar-pulse-functions 'evil-yank)
;; ;; (add-to-list 'pulsar-pulse-functions 'evil-yank-line)
;; (add-to-list 'pulsar-pulse-functions 'evil-delete)
;; (add-to-list 'pulsar-pulse-functions 'evil-delete-line)
;; ;; (add-to-list 'pulsar-pulse-functions 'evil-jump-item)
;; (add-to-list 'pulsar-pulse-functions 'diff-hl-next-hunk)
;; (add-to-list 'pulsar-pulse-functions 'diff-hl-previous-hunk)
;; ))
;;; :lang pkm
;;;; after denotes : Load custom denote
(after! denote
(message "Load: custom denote")
;; no dependency on org-roam, use default's org-id
(require 'denote-funcs)
(require 'denote-config)
(require 'denote-hugo) ; for publish
;; (add-hook 'doom-first-input-hook #'my/refresh-agenda-files)
)
;;;; check consult-denotes
;; (consult-customize
;; my/denote-grep my/denote-find-file
;; :preview-key '("M-m" :debounce 0.3 "<up>" "<down>" "C-j" "C-k"))
;;;; DONT consult-notes-file-dir-sources
(after! consult-notes
(setq consult-notes-file-dir-sources
'(
;; ("root" ?r "~/sync/org")
("meta/Hub" ?h "~/sync/org/meta")
;; ("bib/Literature" ?b "~/sync/org/bib")
;; ("notes/Fleeting" ?n "~/sync/org/notes")
;; ("posts/Permanent" ?p "~/sync/org/posts")
;; ("llmlog/AI" ?l "~/sync/org/llmlog")
;; ("docs/Zettels" ?d "~/sync/org/docs")
;; ("07.Journal" ?j "~/sync/org/journal")
;; ("09.Ekg" ?e "~/sync/org/ekg")
;; ("10.MD" ?m "~/sync/org/md")
;; ("11.Import" ?i "~/sync/org/import")
;; ("12.Talks" ?t "~/sync/org/talks")
)))
;;; Waiting
;;;; atomic-chrome
(use-package! atomic-chrome
:if window-system
:defer 4
:commands (atomic-chrome-start-server)
:config
(atomic-chrome-start-server))
;;;; google-translte
(use-package! google-translate
:defer 3
:init
(require 'google-translate)
:init
(autoload 'google-translate-translate "google-translate-core-ui" "google-translate-translate" nil nil)
:config
;; load +google-translate
(load! "+google-translate")
(defadvice! google-translate-at-point--set-lang-auto (fn &optional override-p)
:around #'google-translate-at-point
(pcase-let ((`(,src ,tgt)
(alist-get current-input-method
'((nil . (en ko))
("korean-hangul" . (ko en)))
nil nil #'string-equal)))
(let ((google-translate-default-source-language (symbol-name src))
(google-translate-default-target-language (symbol-name tgt)))
(funcall-interactively fn override-p))))
(defun google-translate-to-korean (&optional str)
"Translate given string automatically without language selection prompt."
(let ((lang
(cond
((string-match "[가-힣]" str)
"ko")
((or (string-match "[ァ-ヶー]" str)
(string-match "[ぁ-んー]" str)
;; (string-match "[亜-瑤]" str)
)
"ja")
((string-match "[一-龥]" str)
"zh-CN")
(t
"en"))))
(google-translate-translate
lang
(if (string= "ko" lang)
"en"
"ko")
str)))
(setq google-translate-input-method-auto-toggling t
google-translate-preferable-input-methods-alist
'((nil . ("en"))
(korean-hangul . ("ko"))))
(setq google-translate-show-phonetic t)
(setq google-translate-pop-up-buffer-set-focus t)
(setq google-translate-default-source-language "auto"
google-translate-default-target-language "ko")
;; it doesn't pop to the buffer automatically
(defun google-translate--find-buffer (x)
(pop-to-buffer "*Google Translate*"))
(advice-add 'google-translate-buffer-output-translation :after #'google-translate--find-buffer)
(add-to-list
'display-buffer-alist
'("\\*Google Translate\\*"
(display-buffer-reuse-window
display-buffer-in-direction)
(direction . right)
(window . root)
(window-width . 0.25)))
)
;;;; TODO translate-mode
(use-package! translate-mode
:defer 5
;; :hook (translate-mode . translate//set-translate-mode-paragraph-functions)
)
;; (progn
;; (defun translate/translate-current-reference-paragraph ()
;; "Show all available translations of the reference paragraph at point in a pop-up frame."
;; (interactive)
;; (gt-translate translate//paragraph-translator))
;; (defun translate/translate-word-at-point ()
;; "Pop-up translations of the word at point."
;; (interactive)
;; (gt-translate translate//word-translator))
;; (defun translate//set-translate-mode-paragraph-functions ()
;; (cond ((eq major-mode 'markdown-mode)
;; (setq translate-forward-paragraph-function 'markdown-forward-paragraph
;; translate-backward-paragraph-function 'markdown-backward-paragraph))
;; ((eq major-mode 'org-mode)
;; (setq translate-forward-paragraph-function 'org-forward-paragraph
;; translate-backward-paragraph-function 'org-backward-paragraph))))
;; )
;;;; TODO go-translate v3 API
;; M-x gt-do-translate
;; /vanilla/douo-dotfiles-kitty/init.el
(use-package! go-translate
:defer t
:after pdf-tools
:if window-system
:commands (douo/go-do-translate douo/pdf-view-translate)
:init
(setq gt-langs '(en ko))
;; Translate by paragraph and insert each result at the end of source paragraph
;; This configuration is suitable for translation work. That is: Translate -> Modify -> Save
(defun douo/go-do-translate (text-property-string)
(gt-start (gt-translator
:taker (gt-taker
;; 单个换行替换为空格
:text (replace-regexp-in-string
"\\([^\n]\\)\n\\([^\n]\\)" "\\1 \\2"
text-property-string))
:engines (gt-google-engine)
:render (gt-posframe-pop-render))))
:custom
(gt-cache-p t)
(gt-default-translator
(gt-translator
:taker (gt-taker :langs '(en ko) :text (lambda () (replace-regexp-in-string
"\\([^\n]\\)\n\\([^\n]\\)" "\\1 \\2"
(thing-at-point 'paragraph)))
:prompt t
)
:engines (gt-google-engine)
:render (gt-buffer-render)))
:bind
(:map pdf-view-mode-map
;; consult 不支持与 pdf-tools 的交互
;; ("C-s" . isearch-forward)
;; ("C-r" . isearch-backward)
("C-t" . douo/pdf-view-translate))
(:map embark-prose-map ;; 覆盖 transpose-xxx
("t" . douo/go-do-translate))
(:map embark-region-map ;; 覆盖 transpose-regions
("t" . douo/go-do-translate))
:config
(setq gt-chatgpt-key user-openai-api-key)
;; (setq gt-chatgpt-model "gpt-4o-mini")
(require 'pdf-tools)
;; 自定义 pdf 翻译文本提取器
;; 如果有高亮返回高亮文本,无则返回整页文本
(defun douo/gts-pdf-view-selection-texter ()
(unless (pdf-view-active-region-p)
(pdf-view-mark-whole-page))
;; remove-newline-characters-if-not-at-the-end-of-sentence
;; ::HACK:: 解决 pdf 提取文本不能正确断行的问题
;; 移除不是处于句尾[.!?]的换行符
(replace-regexp-in-string "\\([^.!?]\\)\n\\([^ ]\\)" "\\1 \\2"
(car (pdf-view-active-region-text))))
(defvar douo/pdf-translater
(gt-translator
:taker (gt-taker :text 'douo/gts-pdf-view-selection-texter)
:engines (list (gt-google-engine))
:render (gt-buffer-render)
;; :splitter (gts-paragraph-splitter)
))
(defun douo/pdf-view-translate ()
(interactive)
(gt-start douo/pdf-translater)
;; cancel selection in emacs
(deactivate-mark))
) ; end-of go-translate
;; (setq gt-default-translator
;; (gt-translator
;; :taker (gt-taker :text 'buffer :pick 'paragraph)
;; :engines (gt-google-engine)
;; :render (gt-insert-render :type 'after)))
;; Translate the current paragraph and replace it with the translation result
;; This configuration is suitable for scenes such as live chat. Type some text, translate it, and send it
;; (setq gt-default-translator
;; (gt-translator
;; :taker (gt-taker :text 'paragraph :pick nil)
;; :engines (gt-google-engine)
;; :render (gt-insert-render :type 'replace)))
;; Translate specific words in current paragraph and insert the result after each word
;; This configuration can help in reading articles with some words you don't know
;; (setq gt-default-translator
;; (gt-translator
;; :taker (gt-taker :text 'paragraph
;; :pick 'word
;; :pick-pred (lambda (w) (length> w 6)))
;; :engines (gt-google-engine)
;; :render (gt-insert-render :type 'after
;; :rfmt " (%s)"
;; :rface '(:foreground "grey"))))
;; (setq gt-default-translator
;; (gt-translator :taker (gt-taker :pick nil :prompt t)
;; :engines (gt-chatgpt-engine :stream t)
;; :render (gt-insert-render)))
;;;; TODO IDE Layout with Side Windows
;; https://whhone.com/emacs-config/#ide-layout-with-side-windows
;;;; browse-hist
(use-package! browser-hist
:init
(require 'embark) ; load Embark before the command (if you're using it)
:config
(setq browser-hist-db-paths
'((edge . "/home/junghan/.config/microsoft-edge/Default/History")
(whale . "/home/junghan/.config/naver-whale/Default/History")
(chrome . "$HOME/.config/google-chrome/Default/History")
(brave . "$HOME/.config/BraveSoftware/Brave-Browser/Default/History")
(firefox . "$HOME/.mozilla/firefox/*.default-release-*/places.sqlite")
(qutebrowser . "$HOME/.local/share/qutebrowser/history.sqlite")))
(setq browser-hist--db-fields
'((chrome "title" "url" "urls" "ORDER BY last_visit_time desc")
(edge "title" "url" "urls" "ORDER BY last_visit_time desc")
(whale "title" "url" "urls" "ORDER BY last_visit_time desc")
(qutebrowser "title" "url" "History" "ORDER BY atime desc")
(brave "title" "url" "urls" "ORDER BY last_visit_time desc")
(firefox "title" "url" "moz_places" "ORDER BY last_visit_date desc")
))
(setq browser-hist-default-browser 'edge)
:commands (browser-hist-search)
)
;;;; DONT dictionary-overlay
;; 수정이 필요할 듯
;; https://github.com/ginqi7/dictionary-overlay
;; (use-package! dictionary-overlay)
;;;; TODO cfw: my-open-calendar
;; init.el :app calendar
;; (defun my-open-calendar ()
;; (interactive)
;; (cfw:open-calendar-buffer
;; :contents-sources
;; (list
;; (cfw:org-create-source "Green") ; org-agenda source
;; (cfw:org-create-file-source "cal" "/path/to/cal.org" "Cyan") ; other org source
;; (cfw:howm-create-source "Blue") ; howm source
;; (cfw:cal-create-source "Orange") ; diary source
;; (cfw:ical-create-source "Moon" "~/moon.ics" "Gray") ; ICS source1
;; (cfw:ical-create-source "gcal" "https://..../basic.ics" "IndianRed") ; google calendar ICS
;; )))
;;;; TODO paw
;; https://emacs-china.org/t/paw-el-emacs-lingq/27331/71
;; (use-package! paw
;; :defer t)
;; (set-popup-rules! '(("^\\*paw-view-note*" :size 0.35 :side right :quit t :modeline t :select nil :ttl nil :vslot 2 :slot 1)
;; ("^\\*paw-sub-note*" :height 0.5 :side right :quit t :modeline t :select t :ttl nil :vslot 2 :slot 2)))
;;;; TODO presentation - dslide and moc
(use-package! dslide :defer t)
(use-package! default-text-scale :defer t)
(use-package! moc :after default-text-scale :defer t)
;;; :custom 'Local' Packages
;;;; TODO elot : literate ontology tools
;; (add-to-list 'load-path "~/sync/emacs/forked-pkgs/elot")
;; (use-package! elot ; better
;; :defer t)
;;;; TODO emacs-bluesky
;; (add-to-list 'load-path "~/sync/emacs/git/junghan0611/emacs-bluesky/")
;; (load-file "~/sync/emacs/git/junghan0611/emacs-bluesky/bluesky.el")
;;;; pylookup
(use-package! pylookup
:commands (pylookup-lookup pylookup-update pylookup-update-all)
:config
;; (spacemacs/set-leader-keys-for-major-mode 'python-mode
;; "hH" 'pylookup-lookup)
;; (evilified-state-evilify-map pylookup-mode-map
;; :mode pylookup-mode)
(setq
pylookup-dir (concat user-dotemacs-dir "local/pylookup/")
pylookup-program (concat pylookup-dir "pylookup.py")
pylookup-db-file (concat pylookup-dir "pylookup.db"))
(setq pylookup-completing-read 'completing-read)
(setq pylookup-html-locations '("http://docs.python.org/ko/3.10")))
;;;; prot-dired-grep-marked-files
(require 'prot-dired)
;;; Load Unified Configuration
;; unified config for spacemacs and doom emacs
(require 'uniconfig)
;;; Load Transient & Hydra Menu
(require 'hydrakeys)
;;; Load Keys