-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
executable file
·2385 lines (2170 loc) · 103 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
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
;;; Init.el --- Emacs Configuration --- -*- lexical-binding: t; -*-
;;; Commentary:
(add-to-list 'load-path "~/.emacs.d/site-lisp/benchmark-init-el")
(defvar windows-system-p
(string-equal system-type "windows-nt")
"Judge whether it's Windows system.")
;; (if windows-system-p
;; (progn
;; (require 'benchmark-init)
;; (prefer-coding-system 'utf-8))
;; (require 'benchmark-init-loaddefs)
;; )
(require 'benchmark-init)
(benchmark-init/activate)
;; (add-hook 'after-init-hook 'benchmark-init/deactivate)
(setq custom-file "~/.emacs.d/custom.el"
load-prefer-newer t)
(load "~/.emacs.d/custom.el")
(let ((file-name-handler-alist nil))
;; (require 'package)
;; (package-initialize)
;; (setq package-archives
;; '(("gnu" .
;; "https://mirrors.sjtug.sjtu.edu.cn/emacs-elpa/gnu/")
;; ("nongnu" .
;; "https://mirrors.sjtug.sjtu.edu.cn/emacs-elpa/nongnu/")
;; ("melpa" .
;; "https://mirrors.sjtug.sjtu.edu.cn/emacs-elpa/melpa/"))
;; ;; “Gnu”应该和“melpa”同优先级, 从而默认选取二者中较新的 package.
;; package-archive-priorities '(("gnu" . 1)
;; ("nongnu" . 0)
;; ("melpa" . 1))
;; package-menu-hide-low-priority t
;; ;; 暂时不知道检查签名有什么用,先关了再说.
;; package-check-signature nil
;; eldoc-documentation-function 'eldoc-documentation-compose
;; )
;;; Emacs Default Setting
(load "~/.emacs.d/lisp/init-func.el")
(let ((packages (find-subdir-recursively "~/.emacs.d/site-lisp")))
(setq load-path (append load-path packages)))
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/site-lisp/treemacs/src/elisp")
(add-to-list 'load-path "~/.emacs.d/site-lisp/treemacs/src/extra/")
(add-to-list 'load-path "~/.emacs.d/site-lisp/lsp-mode/clients")
(add-to-list 'load-path "~/.emacs.d/site-lisp/lsp-mode/scripts")
(add-to-list 'load-path "~/.emacs.d/site-lisp/lsp-mode/docs")
(add-to-list 'load-path "~/.emacs.d/site-lisp/vertico/extensions")
(add-to-list 'load-path "~/.emacs.d/site-lisp/themes/themes")
(add-to-list 'load-path "~/.emacs.d/site-lisp/pdf-tools/lisp")
(add-to-list 'load-path "~/.emacs.d/site-lisp/verilog-ext")
(load "~/.emacs.d/site-lisp/loaddefs.el")
;; (load "~/.emacs.d/lisp/init-gc.el")
;; (load "~/.emacs.d/lisp/init-icons.el")
;; (load "~/.emacs.d/lisp/init-meow.el")
;; (load "~/.emacs.d/lisp/init-keybindings.el")
;; (load "~/.emacs.d/lisp/init-lsp.el")
;; (load "~/.emacs.d/lisp/init-dired.el")
;; (load "~/.emacs.d/lisp/init-chinese.el")
;; (load "~/.emacs.d/lisp/init-input.el")
;; (load "~/.emacs.d/lisp/init-eaf.el")
;; (load "~/.emacs.d/lisp/init-org.el")
;; (load "~/.emacs.d/lisp/init-verilog.el")
;; (load "~/.emacs.d/lisp/init-reader.el")
;; (load "~/.emacs.d/lisp/init-hydra.el")
;; (load "~/.emacs.d/lisp/latex-node.el")
;; (load "~/.emacs.d/lisp/init-latex.el")
;; (load "~/.emacs.d/lisp/init-base.el")
(setq eat-kill-buffer-on-exit t
css-indent-offset 2
set-mark-command-repeat-pop t
other-window-scroll-default 'get-lru-window
backup-directory-alist '(("." . "~/.emacs.d/backup"))
ispell-dictionary "en_US"
;; ispell-program-name "hunspell"
;; package-quickstart nil
)
;;; @1. GC
(add-hook 'minibuffer-setup-hook 'gc-minibuffer-setup-hook)
(add-hook 'minibuffer-exit-hook 'gc-minibuffer-exit-hook)
;;; @2. flymake and flycheck
(with-eval-after-load 'flycheck
(flycheck-def-config-file-var flycheck-verilog-verilator-command-file verilog-verilator "commands.f")
(flycheck-define-checker verilog-verilator
"A Verilog syntax checker using the Verilator Verilog HDL simulator.
See URL `https://www.veripool.org/wiki/verilator'."
;; https://verilator.org/guide/latest/exe_verilator.html
;; The three flags -y, +incdir+<dir> and -I<dir> have similar effect;
;; +incdir+<dir> and -y are fairly standard across Verilog tools while -I<dir> is used by many C++ compilers.
:command ("verilator" "--lint-only" "-Wall" "-Wno-fatal" "--timing"
"--bbox-unsup" ; Blackbox unsupported language features to avoid errors on verification sources
"--bbox-sys" ; Blackbox unknown $system calls
(option-list "-I" nil concat)
(option-list "-I" nil concat)
(config-file "-f" flycheck-verilog-verilator-command-file)
(eval (remove buffer-file-name nil))
(eval (remove buffer-file-name nil))
source)
:error-patterns
((warning line-start "%Warning-" (zero-or-more not-newline) ": " (file-name) ":" line ":" column ": " (message) line-end)
(error line-start "%Error: Internal Error: " (file-name) ":" line ":" column ": " (message) line-end)
(error line-start "%Error: " (file-name) ":" line ":" column ": " (message) line-end)
(error line-start "%Error-" (zero-or-more not-newline) ": " (file-name) ":" line ":" column ": " (message) line-end))
:modes (verilog-mode verilog-ts-mode))
(add-hook 'flycheck-mode-hook '(lambda ()
(flycheck-set-indication-mode 'left-margin)))
)
(add-to-list 'load-path "~/.emacs.d/site-lisp/nerd-icons.el")
(add-to-list 'load-path "~/.emacs.d/site-lisp/treemacs-nerd-icons")
(add-to-list 'load-path "~/.emacs.d/site-lisp/nerd-icons-dired")
(require 'nerd-icons)
(setq nerd-icons-font-family "InputMono Nerd Font")
(defface diagnostics-error
'(
(((background dark)) :background "#090c10" :foreground "#f85149")
(((background light)) :foreground "#cb2431")
)
"Face for flymake Error."
:group 'flymake)
(defface diagnostics-warn
'(
(((background dark)) :background "#090c10" :foreground "#f0883e")
(((background light)) :foreground "#bf8803")
)
"Face for flymake Warn."
:group 'flymake)
(defface diagnostics-info
'((((background dark)) :background "#090c10" :foreground "#75beff" :box (:line-width (5 . -1) :color "#000000"))
;; (((background light)) :foreground "#75beff" :box (:line-width (5 . -1) :color "white"))
(((background light)) :foreground "#1155ff" :box (:line-width (5 . -1) :color "white"))
)
"Face for flymake Info."
:group 'flymake)
(setq flymake-no-changes-timeout nil
flymake-indicator-type 'margins
flymake-margin-indicators-string
;; `((error "" compilation-error)
;; (warning "" compilation-warning)
;; (note "" compilation-info))
;; `((error "" diagnostics-error)
;; `((error "" diagnostics-error)
;; (warning "" diagnostics-warn)
;; (note "" diagnostics-info))
`((error ,(nerd-icons-octicon "nf-oct-x_circle_fill") diagnostics-error)
(warning "" diagnostics-warn)
(note "" diagnostics-info))
;; flymake-autoresize-margins nil
flymake-show-diagnostics-at-end-of-line t
)
(setq-default ;; left-fringe-width 1
left-margin-width 1)
;; (with-eval-after-load 'flymake
;; (defvar verilog--flymake-proc nil
;; "A flymake verilog process.")
;; (defvar verilog-flymake-command '("verilator" "--lint-only" "-Wall" "-Wno-fatal" "--timing"
;; "--bbox-unsup" "--bbox-sys")
;; "Command for verilog's flymake.")
;; (defvar verilog--flymake-output-buffer " *stderr of verilog-flymake*"
;; "Buffer for verilog's flymake output.")
;; (defun verilog-flymake-done (report-fn
;; source-buffer
;; output-buffer)
;; (with-current-buffer source-buffer
;; (save-excursion
;; (save-restriction
;; (with-current-buffer output-buffer
;; (goto-char (point-min))
;; (let ((diags))
;; (while (search-forward-regexp
;; "^\\(%.*\\): .*:\\([0-9]+\\):\\([0-9]+\\): \\(.*\\)$"
;; nil t)
;; (let* ((msg (match-string 4))
;; (level-msg (match-string 1))
;; (line (string-to-number (match-string 2)))
;; (locate-string)
;; (cal)
;; (beg)
;; (end)
;; (level))
;; (setq level (cond
;; ((string-match-p "%Error" level-msg) ':error)
;; ((string-match-p "%Warning" level-msg) ':warning)
;; (t :note)))
;; (search-forward-regexp "\\(\\^~*\\)" nil t)
;; (setq cal (length (match-string 1)))
;; (let ((current (point))
;; (line-beginning (line-beginning-position)))
;; (forward-line -1)
;; (forward-char (- current line-beginning))
;; (setq locate-string (buffer-substring-no-properties (- (point) cal) (point))))
;; (setq beg (with-current-buffer source-buffer
;; (save-excursion
;; (save-restriction
;; (goto-char (point-min))
;; (or (equal line 1)
;; (forward-line (- line 1)))
;; (search-forward locate-string nil t)
;; (- (point) cal)
;; ))))
;; (setq end (+ beg cal))
;; (setq diags
;; (cons (flymake-make-diagnostic
;; source-buffer beg end level msg)
;; diags))
;; ))
;; (funcall report-fn diags)
;; )))))
;; )
;; (defun verilog-flymake-detect (report-fn &rest _args)
;; "A Flymake backend for verilog.
;; Spawn an verilog lsp process that byte-compiles a file representing the
;; current buffer state and calls REPORT-FN when done."
;; (when verilog--flymake-proc
;; (when (process-live-p verilog--flymake-proc)
;; (kill-process verilog--flymake-proc)))
;; (let ((source-buffer (current-buffer))
;; (coding-system-for-write 'utf-8-unix)
;; (coding-system-for-read 'utf-8))
;; (save-restriction
;; (widen)
;; (let* ((output-buffer (generate-new-buffer " *verilog-flymake*")))
;; (setq verilog--flymake-proc
;; (make-process
;; :name "verilog-flymake-process"
;; :buffer output-buffer
;; :command (append verilog-flymake-command
;; (list (buffer-file-name source-buffer)))
;; :connection-type 'pipe
;; :sentinel
;; (lambda (proc _event)
;; (unless (process-live-p proc)
;; (unwind-protect
;; (cond
;; ((not (and (buffer-live-p source-buffer)
;; (eq proc (with-current-buffer source-buffer
;; verilog--flymake-proc))))
;; (flymake-log :warning
;; "verilog-flymake process %s obsolete" proc))
;; ((memq (process-status proc) '(exit signal))
;; (verilog-flymake-done report-fn
;; source-buffer
;; verilog--flymake-output-buffer
;; ))
;; (t
;; (funcall report-fn
;; :panic
;; :explanation
;; (format "process %s died" proc))))
;; (kill-buffer verilog--flymake-output-buffer)
;; )))
;; :stderr verilog--flymake-output-buffer
;; :noquery t))))))
;; (defun verilog-setup-flymake-backend ()
;; (add-hook 'flymake-diagnostic-functions 'verilog-flymake-detect nil t))
;; ;; (add-hook 'verilog-mode-hook 'verilog-setup-flymake-backend)
;; ;; (defun sanityinc/enable-flymake-flycheck ()
;; ;; (setq-local flymake-diagnostic-functions
;; ;; (seq-uniq (append flymake-diagnostic-functions
;; ;; (flymake-flycheck-all-chained-diagnostic-functions)))))
;; )
(dolist (hook '(prog-mode-hook))
(add-hook hook 'flymake-mode)
;; (add-hook hook 'flycheck-mode)
)
(require 'project)
;;; @3. ICONS
;; (load "~/.emacs.d/self-develop/modeline-setting.el")
(add-hook 'dired-mode-hook 'nerd-icons-dired-mode)
(with-eval-after-load 'treemacs
(require 'treemacs-nerd-icons)
(treemacs-load-theme "nerd-icons"))
(add-hook 'ibuffer-mode-hook 'nerd-icons-ibuffer-mode)
(with-eval-after-load 'all-the-icons (load "~/.emacs.d/self-develop/all-the-icons-diy.el"))
;; (with-eval-after-load 'nerd-icons
;; (setq fc-info (nerd-icons-codicon "nf-cod-question" :face '(:inherit flycheck-info-my))
;; fc-warning (nerd-icons-codicon "nf-cod-warning" :face '(:inherit flycheck-warn))
;; fc-error (nerd-icons-codicon "nf-cod-error" :face '(:inherit flycheck-error-my)))
;; )
(load "~/.emacs.d/lisp/init-startup.el")
;;; @4. MEOW
(require 'meow)
(meow-setup)
(setq meow-use-cursor-position-hack t
meow-use-enhanced-selection-effect t
meow--kbd-kill-region "M-w"
meow--kbd-kill-ring-save "C-w")
(meow-global-mode)
;;; @5. KEYBINDINGS
(add-to-list 'load-path "~/.emacs.d/site-lisp/combobulate")
(unless (bound-and-true-p meow-mode)
(progn
(keymap-global-set "M-j" 'open-newline-above)
(keymap-global-set "C-j" 'open-newline-below)
;; (keymap-global-set "M-N" 'windmove-down)
;; (keymap-global-set "M-P" 'windmove-up)
;; (keymap-global-set "M-I" 'windmove-right)
;; (keymap-global-set "M-O" 'windmove-left)
;;replace =isearch-delete-char= with =isearch-del-char=
;; (add-to-list 'load-path "~/.emacs.d/site-lisp/avy")
;; Avy
(keymap-set isearch-mode-map "M-j" 'avy-isearch)
(keymap-global-set "C-'" 'avy-goto-char-in-line)
;; (global-set-key (kbd "C-:") 'avy-goto-char)
;; (global-set-key (kbd "M-g c") 'avy-goto-char-timer)
;; (global-set-key (kbd "M-g w") 'avy-goto-word-1)
;; (global-set-key (kbd "M-g e") 'avy-goto-word-0)
;; (global-set-key (kbd "M-g f") 'avy-goto-line)
;; (global-set-key (kbd "C-c C-j") 'avy-resume)
))
(keymap-global-set "C-s" 'isearch-forward-regexp)
(keymap-global-set "C-r" 'isearch-backward-regexp)
(keymap-global-set "C-k" 'smart-kill-line)
;; (keymap-global-set "M-l" 'downcase-any)
;; (keymap-global-set "M-c" 'capitalize-any)
(keymap-global-set "C-w" 'kill-or-save)
(add-hook 'puni-mode-hook
(lambda ()
(keymap-set puni-mode-map "M-w" 'puni-kill-region)
(keymap-set puni-mode-map "M-k" 'puni-backward-kill-line)
(keymap-unset puni-mode-map "C-w")))
(keymap-set isearch-mode-map "C-h" 'isearch-del-char)
(keymap-global-set "C-h" 'backward-delete-char-untabify)
(keymap-global-set "C-x k" 'kill-current-buffer)
(keymap-global-set "C-x C-r" 'restart-emacs)
(keymap-global-set "C-c g" 'consult-ripgrep)
(keymap-global-set "C-c f" 'consult-fd)
;; @ Efficiency
(keymap-global-set "C-x f" 'find-file)
(keymap-global-set "C-z" 'vundo)
(global-set-key [remap comment-dwim] 'comment-or-uncomment)
;; @ Fingertip
;; (dolist (hook '(emacs-lisp-mode-hook c-mode-hook lisp-mode-hook))
;; (add-hook hook 'fingertip-mode))
(with-eval-after-load 'fingertip
;; 移动
;; ("M-n" . fingertip-jump-left)
;; ("M-p" . fingertip-jump-right)
;; 符号插入
(keymap-set fingertip-mode-map "%" 'fingertip-match-paren) ;括号跳转
(keymap-set fingertip-mode-map "(" 'fingertip-open-round) ;智能 (
(keymap-set fingertip-mode-map "[" 'fingertip-open-bracket) ;智能 [
(keymap-set fingertip-mode-map "{" 'fingertip-open-curly) ;智能 {
(keymap-set fingertip-mode-map ")" 'fingertip-close-round) ;智能 )
(keymap-set fingertip-mode-map "]" 'fingertip-close-bracket) ;智能 ]
(keymap-set fingertip-mode-map "}" 'fingertip-close-curly) ;智能 }
(keymap-set fingertip-mode-map "\"" 'fingertip-double-quote) ;智能 "
(keymap-set fingertip-mode-map "'" 'fingertip-single-quote) ;智能 '
(keymap-set fingertip-mode-map "=" 'fingertip-equal) ;智能 =
(keymap-set fingertip-mode-map "SPC" 'fingertip-space) ;智能 space
(keymap-set fingertip-mode-map "RET" 'fingertip-newline) ;智能 newline
;; 删除
;; ("M-o" . fingertip-backward-delete) ;向后删除
;; ("C-d" . fingertip-forward-delete) ;向前删除
;; ("C-k" . fingertip-kill) ;向前kill
;; 包围
;; ("M-\"" . fingertip-wrap-double-quote) ;用 " " 包围对象, 或跳出字符串
;; ("M-'" . fingertip-wrap-single-quote) ;用 ' ' 包围对象, 或跳出字符串
;; ("M-[" . fingertip-wrap-bracket) ;用 [ ] 包围对象
;; ("M-{" . fingertip-wrap-curly) ;用 { } 包围对象
;; ("M-(" . fingertip-wrap-round) ;用 ( ) 包围对象
;; ("M-)" . fingertip-unwrap) ;去掉包围对象
;; 跳出并换行缩进
;; ("M-:" . fingertip-jump-out-pair-and-newline) ;跳出括号并换行
;; 向父节点跳动
;; ("C-j" . fingertip-jump-up)
)
;; @ Helpful
(keymap-global-set "M-?" 'help-command)
(with-eval-after-load 'help
(define-key global-map [remap describe-function] 'helpful-function)
(define-key global-map [remap describe-key] 'helpful-key)
(define-key global-map [remap describe-variable] 'helpful-variable)
(define-key global-map [remap describe-command] 'helpful-command))
(with-eval-after-load 'init-func
(define-key global-map [remap upcase-word] 'upcase-any)
(define-key global-map [remap downcase-word] 'downcase-any)
(define-key global-map [remap capitalize-word] 'capitalize-any))
;;; @6. LSP
;; (lsp-enable-startup)
(with-eval-after-load 'lsp-mode
(with-eval-after-load 'lsp-ui
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references))
(setq lsp-keymap-prefix "C-c l"
;; lsp-keep-workspace-alive nil
;; lsp-signature-auto-activate nil
lsp-modeline-code-actions-enable nil
lsp-modeline-diagnostics-enable nil
lsp-modeline-workspace-status-enable nil
lsp-headerline-breadcrumb-enable t
lsp-semantic-tokens-enable t
;; lsp-progress-spinner-type 'progress-bar-filled
lsp-enable-file-watchers nil
lsp-enable-folding nil
lsp-enable-symbol-highlighting nil
lsp-enable-text-document-color nil
lsp-enable-indentation nil
lsp-enable-on-type-formatting nil
lsp-enable-indentation nil
;; For diagnostics
;; lsp-diagnostics-disabled-modes '(markdown-mode gfm-mode)
;; Reference Lens
;; lsp-lens-enable nil
;; ui
;; lsp-ui-doc-show-with-cursor nil
lsp-completion-provider :none
lsp-prefer-flymake t
lsp-ui-flycheck-enable nil
lsp-enable-relative-indentation t
)
;; (keymap-set lsp-mode-map "C-c C-d" 'lsp-describe-thing-at-point)
(defun lsp-booster--advice-json-parse (old-fn &rest args)
"Try to parse bytecode instead of json."
(or
(when (equal (following-char) ?#)
(let ((bytecode (read (current-buffer))))
(when (byte-code-function-p bytecode)
(funcall bytecode))))
(apply old-fn args)))
(advice-add (if (progn (require 'json)
(fboundp 'json-parse-buffer))
'json-parse-buffer
'json-read)
:around
#'lsp-booster--advice-json-parse)
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
"Prepend emacs-lsp-booster command to lsp CMD."
(let ((orig-result (funcall old-fn cmd test?)))
(if (and (not test?) ;; for check lsp-server-present?
(not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
lsp-use-plists
(not (functionp 'json-rpc-connection)) ;; native json-rpc
(executable-find "emacs-lsp-booster"))
(progn
(message "Using emacs-lsp-booster for %s!" orig-result)
(cons "emacs-lsp-booster" orig-result))
orig-result)))
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
(add-hook 'lsp-mode-hook 'corfu-mode)
)
(with-eval-after-load 'corfu
(setq corfu-auto t
corfu-cycle t
;; corfu-quit-no-match 'separator ;; t
corfu-auto-prefix 1
corfu-auto-delay 0
corfu-preview-current t
corfu-quit-no-match t
;; corfu-preselect 'prompt
corfu-quit-at-boundary t)
(when (boundp 'meow-insert-exit-hook)
(add-hook 'meow-insert-exit-hook 'corfu-quit))
(keymap-set corfu-map "<tab>" 'corfu-insert)
;; (keymap-set corfu-map "<backtab>" 'corfu-previous)
;; (keymap-set corfu-map "S-<return>" 'corfu-insert)
;; (keymap-unset corfu-map "RET")
(add-to-list 'completion-at-point-functions 'cape-file)
;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
;; (add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-hook 'corfu-mode-hook 'corfu-popupinfo-mode)
(with-eval-after-load 'corfu-popupinfo
(setq corfu-popupinfo-delay '(0.1 . 0.1)))
;; (add-to-list 'corfu-margin-formatters 'kind-icon-margin-formatter)
(add-to-list 'corfu-margin-formatters 'nerd-icons-corfu-formatter))
(with-eval-after-load 'yasnippet
(add-hook 'yas-keymap-disable-hook
(lambda()
(or
(when (boundp 'corfu--frame)
(and
(frame-live-p corfu--frame)
(frame-visible-p corfu--frame)))
(when (boundp 'acm-menu-frame)
(and (frame-live-p acm-menu-frame)
(frame-visible-p acm-menu-frame)))
))))
(with-eval-after-load 'eglot
(setq eglot-send-changes-idle-time 0)
(add-to-list 'eglot-server-programs
'((tex-mode context-mode texinfo-mode bibtex-mode)
. ("texlab")))
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
(add-hook 'eglot-managed-mode-hook 'corfu-mode)
(add-hook 'eglot-managed-mode-hook 'yas-minor-mode)
(when (and windows-system-p (string-match-p "29" emacs-version))
(eglot-booster-mode))
)
(add-hook 'company-mode-hook
(lambda ()
(setq company-tooltip-align-annotations t
company-tooltip-limit 12
company-idle-delay 0
company-echo-delay (if (display-graphic-p) nil 0)
company-minimum-prefix-length 1
company-icon-margin 3
company-require-match nil
company-dabbrev-ignore-case nil
company-dabbrev-downcase nil
company-global-modes '(not erc-mode message-mode help-mode
gud-mode eshell-mode shell-mode)
company-backends '((company-capf :with company-yasnippet)
(company-dabbrev-code company-keywords company-files)
company-dabbrev))
(define-key company-active-map (kbd "C-h") 'delete-backward-char)
(define-key company-active-map (kbd "<tab>") 'company-complete-selection)
;; (setq company-box-icons-alist 'company-box-icons-idea)
(setq company-box-scrollbar 'inherit)
(company-box-mode t)))
(defun company-completion-styles (capf-fn &rest args)
(let ((completion-styles '(basic partial-completion)))
(apply capf-fn args)))
(advice-add 'company-capf :around #'company-completion-styles)
(with-eval-after-load 'lsp-bridge
(add-hook 'lsp-bridge-mode-hook 'yas/minor-mode)
(add-hook 'c++-ts-mode-hook
(lambda ()
(setq-local lsp-bridge-inlay-hint-overlays t)
))
(keymap-set yas-keymap "<tab>" 'acm-complete-or-expand-yas-snippet)
(setq ;; acm-candidate-match-function 'orderless-flex
;; acm-enable-icon t
;; acm-enable-doc t
acm-enable-yas t
acm-enable-tempel t
acm-enable-quick-access nil
acm-enable-search-file-words t
acm-enable-telega nil
acm-enable-tabnine nil
acm-enable-citre t
acm-enable-capf t
;; lsp-bridge-enable-log t
lsp-bridge-enable-signature-help t
lsp-bridge-enable-inlay-hint t
lsp-bridge-enable-diagnostics nil
lsp-bridge-complete-manually nil
;; lsp-bridge-enable-profile t
;; lsp-bridge-multi-lang-server-mode-list nil
acm-backend-lsp-candidate-min-length 2
acm-backend-elisp-candidate-min-length 2
acm-backend-search-file-words-candidate-min-length 3
acm-backend-yas-candidate-min-length 1
;; lsp-bridge-python-command "python3"
;; This will cause `org-roam-node-find' get wrong and I don't know why.
;; lsp-bridge-enable-org-babel t
;; lsp-bridge-c-lsp-server "clangd"
;; lsp-bridge-user-langserver-dir "~/.emacs.d/lisp/langserver"
;; lsp-bridge-user-multiserver-dir "~/.emacs.d/lisp/multilangserver"
)
;; (add-to-list 'lsp-bridge-multi-lang-server-mode-list
;; '((verilog-mode) . "verilog"))
;; (add-to-list 'lsp-bridge-multi-lang-server-extension-list
;; '(("v" "sv") . "verilog"))
;; (setf (cdr (assoc 'verilog-mode lsp-bridge-single-lang-server-mode-list)) '("svlangserver"))
;; (add-to-list 'lsp-bridge-single-lang-server-mode-list '((verilog-mode) . "svlangserver"))
;; (add-to-list 'lsp-bridge-single-lang-server-mode-list '((verilog-mode) . "verible"))
;; (add-to-list 'lsp-bridge-single-lang-server-mode-list '((verilog-mode) . "veridian"))
;; (add-to-list 'lsp-bridge-single-lang-server-mode-list '((verilog-mode) . "svls"))
)
(with-eval-after-load 'kind-icon
(setq kind-icon-use-icons nil
kind-icon-mapping
`(
(array ,(nerd-icons-codicon "nf-cod-symbol_array") :face font-lock-type-face)
(boolean ,(nerd-icons-codicon "nf-cod-symbol_boolean") :face font-lock-builtin-face)
(class ,(nerd-icons-codicon "nf-cod-symbol_class") :face font-lock-type-face)
(color ,(nerd-icons-codicon "nf-cod-symbol_color") :face success)
(command ,(nerd-icons-codicon "nf-cod-terminal") :face default)
(constant ,(nerd-icons-codicon "nf-cod-symbol_constant") :face font-lock-constant-face)
(constructor ,(nerd-icons-codicon "nf-cod-triangle_right") :face font-lock-function-name-face)
(enummember ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
(enum-member ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
(enum ,(nerd-icons-codicon "nf-cod-symbol_enum") :face font-lock-builtin-face)
(event ,(nerd-icons-codicon "nf-cod-symbol_event") :face font-lock-warning-face)
(field ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-variable-name-face)
(file ,(nerd-icons-codicon "nf-cod-symbol_file") :face font-lock-string-face)
(folder ,(nerd-icons-codicon "nf-cod-folder") :face font-lock-doc-face)
(interface ,(nerd-icons-codicon "nf-cod-symbol_interface") :face font-lock-type-face)
(keyword ,(nerd-icons-codicon "nf-cod-symbol_keyword") :face font-lock-keyword-face)
(macro ,(nerd-icons-codicon "nf-cod-symbol_misc") :face font-lock-keyword-face)
(magic ,(nerd-icons-codicon "nf-cod-wand") :face font-lock-builtin-face)
(method ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face)
(function ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face)
(module ,(nerd-icons-codicon "nf-cod-file_submodule") :face font-lock-preprocessor-face)
(numeric ,(nerd-icons-codicon "nf-cod-symbol_numeric") :face font-lock-builtin-face)
(operator ,(nerd-icons-codicon "nf-cod-symbol_operator") :face font-lock-comment-delimiter-face)
(param ,(nerd-icons-codicon "nf-cod-symbol_parameter") :face default)
(property ,(nerd-icons-codicon "nf-cod-symbol_property") :face font-lock-variable-name-face)
(reference ,(nerd-icons-codicon "nf-cod-references") :face font-lock-variable-name-face)
(snippet ,(nerd-icons-codicon "nf-cod-symbol_snippet") :face font-lock-string-face)
(string ,(nerd-icons-codicon "nf-cod-symbol_string") :face font-lock-string-face)
(struct ,(nerd-icons-codicon "nf-cod-symbol_structure") :face font-lock-variable-name-face)
(text ,(nerd-icons-codicon "nf-cod-text_size") :face font-lock-doc-face)
(typeparameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face)
(type-parameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face)
(unit ,(nerd-icons-codicon "nf-cod-symbol_ruler") :face font-lock-constant-face)
(value ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-builtin-face)
(variable ,(nerd-icons-codicon "nf-cod-symbol_variable") :face font-lock-variable-name-face)
(t ,(nerd-icons-codicon "nf-cod-code") :face font-lock-warning-face))))
;;; @7. DIRED
(add-to-list 'load-path "~/.emacs.d/site-lisp/dirvish")
(add-to-list 'load-path "~/.emacs.d/site-lisp/dirvish/extensions")
(add-hook 'dired-mode-hook
(lambda ()
(or (boundp 'diredfl-mode)
(load "~/.emacs.d/site-lisp/diredfl/diredfl.el"))
(toggle-truncate-lines)
(diredfl-mode)
;; (require 'image-dired)
;; (require 'dirvish)
))
(with-eval-after-load 'dired
(setq dired-listing-switches
"-l --almost-all --human-readable --time-style=long-iso --group-directories-first --no-group"
dired-dwim-target t
dired-mouse-drag-files t
dired-auto-revert-buffer t
dired-do-revert-buffer t
mouse-drag-and-drop-region-cross-program t
dired-kill-when-opening-new-dired-buffer t
dired-recursive-copies 'always
;; dired-recursive-deletes 'always
delete-by-moving-to-trash t
image-dired-thumb-size 256
image-dired-marking-shows-next nil)
(defun dired-open-externally (&optional arg)
"Open marked or current file in operating system's default application."
(interactive "P")
(dired-map-over-marks
(embark-open-externally (dired-get-filename))
arg))
(keymap-set dired-mode-map "e" 'dired-open-externally))
(with-eval-after-load 'dirvish
;; (dirvish-peek-mode)
;; (require 'dirvish-side)
(dirvish-override-dired-mode)
(dirvish-side-follow-mode)
;; (add-hook 'dirvish-setup-hook 'dirvish-emerge-mode)
(setq dirvish-attributes '(vc-state nerd-icons file-size subtree-state collapse file-time)
dirvish-side-width 35
dirvish-emerge-groups '(("Recent files" (predicate . recent-files-2h))
("Video" (extensions "mp4" "mkv" "webm"))
("Pictures" (extensions "jpg" "png" "jpeg" "svg" "gif"))
("Audio" (extensions "mp3" "flac" "wav" "ape" "aac"))
("Archives" (extensions "gz" "rar" "zip")))
dirvish-path-separators '(" ~" " /" "/")
;; dirvish-hide-details nil
dirvish-mode-line-height 20
;; dirvish-show-media-properties t
;; Turn off media cache, but it will slow down the speed of media preview
dirvish-media-auto-cache-threshold nil
;; dirvish-preview-dispatch (remove 'epub dirvish-preview-dispatch)
)
(keymap-set dirvish-mode-map "TAB" #'dirvish-toggle-subtree))
;; @8. CHINESE
(add-to-list 'load-path "~/.emacs.d/site-lisp/emacs-chinese-word-segmentation")
(setq cns-prog "~/.emacs.d/site-lisp/emacs-chinese-word-segmentation/cnws"
cns-dict-directory "~/.emacs.d/site-lisp/emacs-chinese-word-segmentation/cppjieba/dict"
;; To use other program for word segmentation, set cns-process-shell-command:
;; cns-process-shell-command "word_segmentation_program arg1 arg2..."
;; disable debug output, default is t
cns-recent-segmentation-limit 20
cns-debug nil)
(require 'cns nil t)
(when (featurep 'cns)
(add-hook 'find-file-hook 'cns-auto-enable))
;; @9. INPUT
(add-to-list 'load-path "~/.emacs.d/site-lisp/emacs-rime")
(with-eval-after-load 'rime
(set-face-attribute 'rime-default-face nil :height 1.2)
(set-face-attribute 'rime-highlight-candidate-face nil :height 1.2)
(set-face-attribute 'rime-preedit-face nil :underline t
:inverse-video 'unspecified)
(defun rime-predicate-meow-mode-p ()
"Detect whether the current buffer is in `meow' state.
Include `meow-normal-state' , `meow-motion-state'.
Can be used in `rime-disable-predicates' and `rime-inline-predicates'."
(and (fboundp 'meow-mode)
(meow-normal-mode-p)
))
(defun rime-predicate-tex-advance-p ()
"If point is inside a (La)TeX math environment, or a (La)TeX command."
(if (derived-mode-p 'tex-mode)
(or (and (featurep 'tex-site)
(texmathp))
(and rime--current-input-key
(or (= #x24 rime--current-input-key)
(= #x5c rime--current-input-key))
(or (= (point) (line-beginning-position))
(= #x20 (char-before))
(rime-predicate-after-ascii-char-p)))
(and (> (point) (save-excursion (back-to-indentation) (point)))
(let ((string (buffer-substring (point) (max (line-beginning-position) (- (point) 80)))))
(or (or (string-match-p "[\x5c][\x21-\x24\x26-\x7a\x7c\x7e]*$" string)
(if (string-match-p "[\x5c][a-zA-Z\x23\x40]+[\x7b][^\x7d\x25]*$" string)
(if (and (string-match-p "[\x5c]\\(begin\\)\\|\\(end\\)[\x7b]" string)
(= (char-before) #x7b))
t
(if (> (char-before) #x7b)
(and rime--current-input-key
(or (= #x7e rime--current-input-key)
(= #x7c rime--current-input-key)))
())
())))
(string-match-p "[a-zA-Z][0-9\x21-\x23\x25-\x2f\x3a-\x40\x5b-\x60\x7a\x7c\7e\x7f]*$" string)
))))
(rime-predicate-after-ascii-char-p)))
(keymap-set rime-mode-map "s-`" 'rime-send-keybinding)
;; (define-key rime-mode-map (kbd "Shift") 'rime-send-keybinding)
(define-key rime-mode-map (kbd "C-t") 'rime-inline-ascii)
(define-key minibuffer-mode-map (kbd "C-t") 'rime-inline-ascii)
(setq default-input-method "rime"
rime-user-data-dir "~/.local/share/fcitx5/rime" ;; "~/.emacs.d/rime/"
rime-show-candidate 'posframe
rime-show-preedit 't
rime-translate-keybindings '("C-f" "C-b" "C-n" "C-p" "C-g" "<left>" "<right>" "<up>" "<down>" "<prior>" "<next>" "<delete>" "C-h")
rime-posframe-properties (list :internal-border-width 3)
rime-posframe-style 'vertical
;; (list :font "Source Han Serif SC"
;; :background-color "#333333"
;; :internal-border-width 10)
rime-disable-predicates
'(rime-predicate-space-after-cc-p
rime-predicate-current-uppercase-letter-p
;; rime-predicate-after-alphabet-char-p
;; rime-predicate-after-ascii-char-p
rime-predicate-prog-in-code-p
rime-predicate-hydra-p
;; rime-predicate-evil-mode-p
rime-predicate-meow-mode-p
rime-predicate-tex-advance-p
)
;; rime-deactivate-when-exit-minibuffer t
rime-inline-ascii-trigger 'shift-l
)
(keymap-set rime-mode-map "M-o" 'rime-force-enable)
;; (with-eval-after-load 'tex
;; (add-to-list 'rime-disable-predicates
;; 'rime-predicate-tex-advance-p))
)
;; (keymap-global-set "C-\\" 'rime-commit-and-toggle-input-method)
(defun rime-commit1-and-toggle-input-method ()
"Commit the 1st item if exists, then toggle input method."
(interactive)
(require 'rime)
(ignore-errors (rime-commit1))
(toggle-input-method))
(keymap-global-set "C-\\" 'rime-commit1-and-toggle-input-method)
;; (require 'pyim-wbdict)
;; (require 'pyim)
;; (setq default-input-method "pyim")
;; (setq pyim-page-length 7)
;; (setq pyim-page-posframe-border-width 3)
;; (pyim-default-scheme 'wubi)
;; (setq pyim-page-tooltip 'posframe)
;; (if (string-equal (symbol-name (car custom-enabled-themes)) "modus-operandi")
;; (progn
;; (set-face-attribute 'pyim-page nil :inherit 'default :background "#EEE1B3" :foreground "#000000")
;; (set-face-attribute 'pyim-page-border nil :inherit 'pyim-page :background "#000000"))
;; (set-face-attribute 'pyim-page-border nil :inherit 'pyim-page :background "#D7DCC8"))
;; ;; (pyim-wbdict-v86-single-enable)
;; (pyim-wbdict-v98-morphe-enable)
;; (setq-default pyim-english-input-switch-functions
;; '(pyim-probe-isearch-mode
;; pyim-probe-dynamic-english
;; pyim-probe-programe-mode
;; pyim-probe-org-structure-template))
;; (global-set-key "\C-\\" 'toggle-input-method)
;; (global-set-key "\M-i" #'pyim-convert-string-at-point)
;; (global-set-key "\M-p" 'pyim-process-toggle-input-ascii)
;; (global-set-key "\M-j" 'pyim-toggle-input-ascii)
;; @10. EAF
;; (require 'eaf)
(with-eval-after-load 'eaf
(require 'eaf-pdf-viewer)
(setq eaf-pdf-show-progress-on-page nil))
;; @11. ORG
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-roam")
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-modern-indent")
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-modern")
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-appear")
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-bars")
(add-to-list 'load-path "~/.emacs.d/site-lisp/emacsql")
(add-to-list 'load-path "~/.emacs.d/site-lisp/org-visual-outline")
;; Hide spaces of chinese inline block
;; (font-lock-add-keywords 'org-mode
;; '(("\\cc\\( \\)[/+*_=~][^a-zA-Z0-9/+*_=~\n]+?[/+*_=~]\\( \\)?\\cc?"
;; (1 (prog1 () (compose-region (match-beginning 1) (match-end 1) ""))))
;; ("\\cc?\\( \\)?[/+*_=~][^a-zA-Z0-9/+*_=~\n]+?[/+*_=~]\\( \\)\\cc"
;; (2 (prog1 () (compose-region (match-beginning 2) (match-end 2) "")))))
;; 'append)
(with-eval-after-load 'org
(global-org-modern-mode)
(setq org-hide-emphasis-markers t
org-pretty-entities t
prettify-symbols-mode t
prettify-symbols-unprettify-at-point 'right-edge
org-image-actual-width nil
;; org-todo-keywords '((sequence " " " "))
;; org-preview-latex-process-alist '((dvipng :programs
;; ("latex" "dvipng")
;; :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
;; (1.0 . 1.0)
;; :latex-compiler
;; ("latex -interaction nonstopmode -output-directory %o %f")
;; :image-converter
;; ("dvipng -D %D -T tight -o %O %f")
;; :transparent-image-converter
;; ("dvipng -D %D -T tight -bg Transparent -o %O %f"))
;; (dvisvgm :programs
;; ("latex" "dvisvgm")
;; :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "xdv" :image-output-type "svg" :image-size-adjust
;; (1.0 . 1.0)
;; :latex-compiler
;; ("xelatex -no-pdf -interaction nonstopmode -output-directory %o %f")
;; :image-converter
;; ("dvisvgm %f --no-fonts --exact-bbox --scale=%S --output=%O"))
;; (imagemagick :programs
;; ("latex" "convert")
;; :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust
;; (1.0 . 1.0)
;; :latex-compiler
;; ("pdflatex -interaction nonstopmode -output-directory %o %f")
;; :image-converter
;; ("convert -density %D -trim -antialias %f -quality 100 %O")))
;; org-preview-latex-default-process 'dvisvgm
org-format-latex-header "\\documentclass[10pt]{article}\n\\usepackage[usenames]{color}\n[DEFAULT-PACKAGES]\n[PACKAGES]\n\\pagestyle{empty} % do not remove\n% The settings below are copied from fullpage.sty\n
\\usepackage{xeCJK,tikz,caption,float,makecell,circuitikz,array}\n
\\usetikzlibrary{shapes,arrows,calc,arrows.meta}\n
\\usetikzlibrary{circuits.logic.IEC,calc}\n
\\renewcommand{\\arraystretch}{1.3}\n
\\setlength{\\textwidth}{\\paperwidth}\n\\addtolength{\\textwidth}{-3cm}\n\\setlength{\\oddsidemargin}{1.5cm}\n\\addtolength{\\oddsidemargin}{-2.54cm}\n\\setlength{\\evensidemargin}{\\oddsidemargin}\n\\setlength{\\textheight}{\\paperheight}\n\\addtolength{\\textheight}{-\\headheight}\n\\addtolength{\\textheight}{-\\headsep}\n\\addtolength{\\textheight}{-\\footskip}\n\\addtolength{\\textheight}{-3cm}\n\\setlength{\\topmargin}{1.5cm}\n\\addtolength{\\topmargin}{-2.54cm}\n"
)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(jupyter . t)))
(keymap-set org-mode-map "C-c b" 'org-cite-insert)
)
(add-hook 'org-mode-hook
(lambda ()
(electric-indent-local-mode)
(setq-local company-backends '(company-files company-keywords))
(setq org-appear-autolinks t)
(org-appear-mode)
(org-cdlatex-mode)
(custom-theme-set-faces
'user
;; ;; '(fixed-pitch ((t (:family "Input Mono" :height 0.9))))
;; ;; '(variable-pitch ((t (:family "Palatino Linotype" :height 1.0))))
'(org-block ((t (:inherit fixed-pitch))))
'(org-code ((((background light))
(:foreground "#1F2328"
:background "#EFF1F3"
:inherit fixed-pitch))
(((background dark)) (:inherit fixed-pitch))))
;; '(org-table ((t (:inherit variable-pitch))))
'(org-special-keyword ((t (:inherit fixed-pitch))))
'(org-verbatim
((((background light))
(:foreground "#e74c3c"
:box (:line-width 1 :color "#e1e4e5")
:inherit fixed-pitch))
(((background dark))
(:background "#343942"
:foreground "#E6EDF3"
:inherit fixed-pitch))))
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
'(org-block-begin-line ((t (:inherit fixed-pitch))))
'(org-block-end-line ((t (:inherit fixed-pitch))))
'(fill-column-indicator ((t (:inherit (shadow fixed-pitch))))))
(variable-pitch-mode)
;; (company-mode)
;; (corfu-mode)
(visual-line-mode)
(valign-mode)))
;; (with-eval-after-load 'org
;; (defun org-buffer-face-mode-variable ()
;; (interactive)
;; (make-face 'width-font-face)
;; (set-face-attribute 'width-font-face nil :font (font-spec :name "LXGW WenKai Mono";; :name "Sarasa Mono SC"
;; ;; :weight 'semibold
;; :size 13.0)) ;; 等距更纱黑体
;; (setq buffer-face-mode-face 'width-font-face)
;; (buffer-face-mode))
;; (add-hook 'org-mode-hook 'org-buffer-face-mode-variable)
;; (setq org-hide-emphasis-markers t))
;; Org-superstar
;; (add-hook 'org-mode-hook 'org-superstar-mode)
;; Org-modern
(with-eval-after-load 'org-modern
(setq org-modern-todo t
org-modern-table nil
org-modern-tag t
org-modern-priority t
org-modern-keyword t
org-modern-block-name t
org-modern-horizontal-rule t
org-modern-statistics t
org-modern-timestamp t