-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.html
2843 lines (2730 loc) · 163 KB
/
index.html
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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2025-02-12 Wed 23:35 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Modular GNU Emacs Configuration</title>
<meta name="author" content="EnigmaCurry" />
<meta name="generator" content="Org Mode" />
<style type="text/css">
#content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #e6e6e6;
border-radius: 3px;
background-color: #f2f2f2;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
}
pre.src:before {
display: none;
position: absolute;
top: -8px;
right: 12px;
padding: 3px;
color: #555;
background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { }
</style>
<link rel="icon" href="/theme/icon/emacs.ico" type="image/x-icon">
<style>
html, body {
margin: 0;
padding: 0;
min-height: 100vh;
}
body {
background: #121212;
color: #e0e0e0;
font-family: "Bitstream Vera Sans",Verdana,sans-serif;
display: flex;
flex-direction: column;
max-width: 90em;
justify-content: center;
margin:0 auto;
}
code {
color: #ffd269;
font-weight: bold;
font-size: 1.5em;
margin: 0 0.25em 0 0.25em;
}
div#content {
border: 1px solid #666;
background: #1e1e1e;
padding: 2em;
max-width: none;
margin: 0;
margin-bottom: auto;
}
a {
color: #62afff;
text-decoration: none;
padding: 1px
}
a:hover {
color: #ff5370
}
#table-of-contents {
margin: 1em 0;
padding: .1em
}
div#content div#org-div-home-and-up {
background: #001323;
color: #fff
}
div#org-div-home-and-up a:link,div#org-div-home-and-up a:visited {
color: #fff;
background: #001323
}
div#org-div-home-and-up a:hover {
color: #ff5370
}
div.title {
margin: -1em -1em 0;
font-size: 200%;
font-weight: bold;
background: #001323;
color: #fff;
padding: .75em 1em;
font-family: "BitStream Vera Sans",Verdana;
letter-spacing: .1em
}
h1 {
background: #001323;
color: #fff;
font-size: 200%;
font-weight: bold;
letter-spacing: .1em;
margin: -1em -1em .2em;
padding: .75em 1em
}
h2 {
font-size: 180%;
border-bottom: 1px solid #555;
padding: .2em
}
h3,h4 {
font-size: 120%;
border-bottom: 1px solid #444
}
tt {
color: #39f
}
.verbatim {
margin: .5em 0
}
pre.src-shell {
background: #0f1015;
}
pre.src-example {
background: #282928 !important;
}
pre {
font-weight: bolder;
border: none;
padding: 1em;
color: #e0e0e0;
margin: 1em 0 1em 0;
padding: 5pt;
color: #e0e0e0;
font-family: courier,monospace;
font-size: 0.8em;
background: #181f29;
max-width: 90.5em;
border-bottom: 2px solid #573b3b;
}
.verbatim-caption {
border: 1px solid #555;
background: #222;
display: block;
font-size: 80%;
padding: .2em
}
div#postamble {
text-align: left;
color: #999;
font-size: 80%;
padding: 0;
margin: 0
}
div#postamble a {
color: #62afff
}
div#postamble a:hover {
color: #ff5370
}
table {
font-size: 100%;
border-collapse: collapse;
margin: .5em 0;
color: #e0e0e0
}
th,td {
border: 1px solid #555;
padding: .3em;
margin: 2px
}
th {
background: #333
}
span.underline {
text-decoration: underline
}
.fixme {
background: #ff9800;
font-weight: bold
}
.ra {
text-align: right
}
.sidebar {
float: right;
width: 25em;
background-color: #6a1b9a;
color: #fff;
margin: 2em -2em 2em 2em;
padding: 1em
}
.sidebar a {
border: none
}
.sidebar a:link {
color: #80deea
}
.sidebar a:visited {
color: #26c6da
}
.sidebar a:hover {
color: #ffcc80
}
.sidebar a:active {
color: #ff5370
}
.title {
text-align: center
}
.todo {
color: #f44336
}
.done {
color: #4caf50
}
.timestamp {
color: #9e9e9e
}
.timestamp-kwd {
color: #f48fb1
}
.tag {
background-color: #1e88e5;
font-weight: normal
}
.target {
background-color: #8e24aa
}
pre.src:before {
margin-right: 0.5em;
}
.org-ul li {
padding-top: 0.5em;
}
details {
margin: 2em;
}
.code-block-container {
border-radius: 5px;
overflow: visible;
margin-bottom: 1em;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
max-width: 80em;
}
.code-block-header {
background: #0d0d0d;
border-bottom: 2px solid #573b3b;
padding: 0.1em 1em 0.2em 0.5em;
font-family: sans-serif;
font-weight: bold;
font-size: 0.9em;
max-width: 80em;
}
.code-block-header.shell {
color: #27d75b;
}
.code-block-header.lang {
color: #606c71;
}
.code-block-container pre {
margin: 0;
}
span.filename {
font-family: monospace;
font-size: 2em;
margin-left: 0.5em;
}
span.org-parameter {
background-color: #202020;
padding: 0 0.5em;
border-radius: 5px;
font-size: 1.1em;
}
@media screen and (max-width:768px) {
div#content {
padding: 0 0.5em 0.5em 0.5em;
h1.title{margin-top: 0em;
}
}
</style>
</head>
<body>
<div id="content" class="content">
<h1 class="title">Modular GNU Emacs Configuration</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#Goals">1. Goals</a></li>
<li><a href="#LICENSE">2. LICENSE</a></li>
<li><a href="#Dependencies">3. Dependencies</a>
<ul>
<li><a href="#Emacs">3.1. Emacs</a></li>
<li><a href="#Rustup_and_Cargo">3.2. Rustup and Cargo</a></li>
<li><a href="#Git">3.3. Git</a></li>
<li><a href="#Tree-sitter">3.4. Tree-sitter</a></li>
<li><a href="#Create_your_Emacs_config_directory">3.5. Create your Emacs config directory</a></li>
</ul>
</li>
<li><a href="#Early_Init">4. Early Init</a></li>
<li><a href="#Base_config">5. Base config</a>
<ul>
<li><a href="#Core_libraries">5.1. Core libraries</a></li>
<li><a href="#Nice_defaults">5.2. Nice defaults</a></li>
<li><a href="#Configure_file_backups_and_auto-saves">5.3. Configure file backups and auto-saves</a></li>
<li><a href="#Customization">5.4. Customization</a></li>
<li><a href="#Builtin_minor_modes_to_activate_everywhere">5.5. Builtin minor modes to activate everywhere</a></li>
<li><a href="#PATH_setup">5.6. PATH setup</a></li>
<li><a href="#Programming_mode">5.7. Programming mode</a></li>
<li><a href="#Shell_processes">5.8. Shell processes</a></li>
</ul>
</li>
<li><a href="#Cargo">6. Cargo</a>
<ul>
<li><a href="#Set_cargo_binary_PATH">6.1. Set cargo binary PATH</a></li>
<li><a href="#Cargo_functions">6.2. Cargo functions</a></li>
<li><a href="#Justfile">6.3. Justfile</a></li>
</ul>
</li>
<li><a href="#straight.el_and_use-package">7. straight.el and use-package</a>
<ul>
<li><a href="#Lazy-load_straight.el">7.1. Lazy-load straight.el</a></li>
<li><a href="#Track_packages_added_via_use-package">7.2. Track packages added via use-package</a></li>
</ul>
</li>
<li><a href="#Configure_which_modules_to_load">8. Configure which modules to load</a></li>
<li><a href="#Modules">9. Modules</a>
<ul>
<li><a href="#Registers_%28label_%3Dregisters%3D%29">9.1. Registers (label <code>registers</code>)</a>
<ul>
<li><a href="#Position_registers">9.1.1. Position registers</a></li>
</ul>
</li>
<li><a href="#Theme_%28label_%3Dtheme%3D%29">9.2. Theme (label <code>theme</code>)</a></li>
<li><a href="#Fonts_%28label_%3Dfonts%3D%29">9.3. Fonts (label <code>fonts</code>)</a>
<ul>
<li><a href="#List_installed_font_families">9.3.1. List installed font families</a></li>
<li><a href="#Install_font%3A_JetBrains_Mono_Nerdfont">9.3.2. Install font: JetBrains Mono Nerdfont</a></li>
<li><a href="#Set_font_faces">9.3.3. Set font faces</a></li>
<li><a href="#Preview_fonts">9.3.4. Preview fonts</a></li>
</ul>
</li>
<li><a href="#General_keybindings_manager_%28label_%3Dgeneral%3D%29">9.4. General keybindings manager (label <code>general</code>)</a></li>
<li><a href="#Which_key_%28label_%3Dwhich-key%3D%29">9.5. Which key (label <code>which-key</code>)</a></li>
<li><a href="#Org_mode_%28label_%3Dorg%3D%29">9.6. Org mode (label <code>org</code>)</a>
<ul>
<li><a href="#Tangle_Emacs_config_and_write_HTML_document">9.6.1. Tangle Emacs config and write HTML document</a></li>
<li><a href="#Local_HTTP_server_for_displaying_exported_HTML">9.6.2. Local HTTP server for displaying exported HTML</a></li>
<li><a href="#Use_org_headings_as_HTML_anchors">9.6.3. Use org headings as HTML anchors</a></li>
<li><a href="#Template_for_new_org_files">9.6.4. Template for new org files</a></li>
<li><a href="#Org-babel_evaluation">9.6.5. Org-babel evaluation</a></li>
</ul>
</li>
<li><a href="#Completion_%28label_%3Dcompletion%3D%29">9.7. Completion (label <code>completion</code>)</a></li>
<li><a href="#Vterm_%28label_%3Dvterm%3D%29">9.8. Vterm (label <code>vterm</code>)</a></li>
<li><a href="#Markdown_mode_%28label_%3Dmarkdown%3D%29">9.9. Markdown mode (label <code>markdown</code>)</a></li>
<li><a href="#SSH_agent_%28label_%3Dssh-agent%3D%29">9.10. SSH agent (label <code>ssh-agent</code>)</a></li>
<li><a href="#Magit_%28label_%3Dmagit%3D%29">9.11. Magit (label <code>magit</code>)</a></li>
<li><a href="#Scale_text_uniformly_in_all_buffers_%28label_%3Dtext-scale%3D%29">9.12. Scale text uniformly in all buffers (label <code>text-scale</code>)</a></li>
<li><a href="#Justfile_mode_%28label_%3Djust%3D%29">9.13. Justfile mode (label <code>just</code>)</a></li>
<li><a href="#Latin_words_dictionary_and_word_of_the_day_%28label_%3Dlatin-words%3D%29">9.14. Latin words dictionary and word of the day (label <code>latin-words</code>)</a></li>
<li><a href="#Dashboard_%28label_%3Ddashboard%3D%29">9.15. Dashboard (label <code>dashboard</code>)</a></li>
<li><a href="#GPTel_%28label_%3Dgptel%3D%29">9.16. GPTel (label <code>gptel</code>)</a></li>
<li><a href="#LSP_%28label_%3Dlsp%3D%29">9.17. LSP (label <code>lsp</code>)</a></li>
<li><a href="#Avy_%28label_%3Davy%3D%29">9.18. Avy (label <code>avy</code>)</a></li>
<li><a href="#Treesit_%28label_%3Dtreesit%3D%29">9.19. Treesit (label <code>treesit</code>)</a></li>
<li><a href="#S3-publish_%28label_%3Ds3-publish%3D%29">9.20. S3-publish (label <code>s3-publish</code>)</a></li>
<li><a href="#Python_%28label_%3Dpython%3D%29">9.21. Python (label <code>python</code>)</a></li>
<li><a href="#Rust_%28label_%3Drust%3D%29">9.22. Rust (label <code>rust</code>)</a></li>
</ul>
</li>
<li><a href="#Load_modules">10. Load modules</a>
<ul>
<li><a href="#Prioritize_and_load_requested_modules">10.1. Prioritize and load requested modules</a></li>
<li><a href="#cargo-install-my-cargo-dependencies">10.2. Install rust helper programs declared by module</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-Goals" class="outline-2">
<h2 id="Goals"><span class="section-number-2">1.</span> Goals</h2>
<div class="outline-text-2" id="text-1">
<p>
This is a new attempt at writing a depersonalized, copyable, and
modular Emacs config:
</p>
<ul class="org-ul">
<li>All Emacs config (elisp) is written in a single Org Mode file:
<ul class="org-ul">
<li>Config repository: <a href="https://github.com/EnigmaCurry/emacs">https://github.com/EnigmaCurry/emacs</a></li>
<li>Org source file: <a href="https://github.com/EnigmaCurry/emacs/blob/literate-new/emacs.org?plain=1">emacs.org</a></li>
<li>You may <a href="https://github.com/EnigmaCurry/emacs/fork">fork this repository</a> to make it your own.
<ul class="org-ul">
<li>In case this config is already a fork, you may want to start
with the original <a href="https://emacs.rymcg.tech">emacs.rymcg.tech</a> instead.</li>
</ul></li>
</ul></li>
<li>Your configuration is displayed (exported) as a single HTML page:
<ul class="org-ul">
<li>Config page: <a href="https://emacs.rymcg.tech">https://emacs.rymcg.tech</a></li>
<li>This page is easy to search and requires no JavaScript.</li>
</ul></li>
<li>All Org-Babel code blocks are <a href="https://orgmode.org/manual/Extracting-Source-Code.html">"tangled"</a> into normal elisp files and
published to the git repository:
<ul class="org-ul">
<li><a href="https://github.com/EnigmaCurry/emacs/blob/literate-new/emacs.org?plain=1">emacs.org</a> remains the single "source of truth" of this config.</li>
<li>However, it is the tangled elisp files (<a href="https://github.com/EnigmaCurry/emacs/blob/literate-new/init.el">init.el</a>, <a href="https://github.com/EnigmaCurry/emacs/blob/literate-new/modules">modules/*</a>) that
Emacs loads on startup, not emacs.org.</li>
<li>All of the other files in the repository will be overwritten each
time emacs.org is re-tangled.</li>
</ul></li>
<li>Code blocks should be of medium size, grouping related functions:
<ul class="org-ul">
<li>There should be more code here than prose. Avoid having lots of
little code blocks and excessive explanations.</li>
</ul></li>
<li>All custom elisp functions and variables should have the namespace
prefix <code>my/</code> :
<ul class="org-ul">
<li>This configuration is non-proprietary to promote code adoption
by others.</li>
<li>Meme: <a href="https://ec-share.nyc3.digitaloceanspaces.com/i-made-this-1.jpg">"I made this"</a>.</li>
</ul></li>
<li>This config should support multiple platforms: Linux
CLI, Wayland, Android…</li>
<li>Most configuration should be customizable by the user without
needing to edit this file:
<ul class="org-ul">
<li>Run <code>M-x my/custom-settings</code> to open the configuration menu to
save settings on a per-installation basis in
<code>~/.emacs.d/custom.el</code> (and it is <code>.gitignore</code> 'd).</li>
</ul></li>
<li>The base config should work without needing to download any third
party libraries:
<ul class="org-ul">
<li>The custom variable <code>my/machine-labels</code> is used to set
per-machine labels that opt-in to loading additional modules.</li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-LICENSE" class="outline-2">
<h2 id="LICENSE"><span class="section-number-2">2.</span> LICENSE</h2>
<div class="outline-text-2" id="text-2">
<p>
See <a href="LICENSE.txt">LICENSE.txt</a>
</p>
<p>
See <a href="LICENSE_GPLv3.txt">LICENSE_GPLv3.txt</a>
</p>
<p>
This distribution has a <b>mixed license</b> (0BSD and GPLv3). Everything
here that has not been identified in the comments as having been taken
from somewhere else, is licensed/dedicated to you as public domain
(0BSD). Some code has been copied from other sources that are licensed
GPLv3 and so these have been identified as such in the code block
comments. As long as these additional sources are included in this
distribution, this repository is effectively (infectively) licensed as
GPLv3.
</p>
</div>
</div>
<div id="outline-container-Dependencies" class="outline-2">
<h2 id="Dependencies"><span class="section-number-2">3.</span> Dependencies</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-Emacs" class="outline-3">
<h3 id="Emacs"><span class="section-number-3">3.1.</span> Emacs</h3>
<div class="outline-text-3" id="text-3-1">
<p>
You will need a recent version of Emacs.
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell"><span style="color: #7f7f7f;">#</span><span style="color: #7f7f7f;">e.g., on Fedora:</span>
sudo dnf install emacs
</pre>
</div></div>
<div class="code-block-container"><div class="code-block-header lang">(untangled) emacs-lisp</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(message (emacs-version))
</pre>
</div></div>
<pre class="example">
GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2)
of 2025-01-03
</pre>
</div>
</div>
<div id="outline-container-Rustup_and_Cargo" class="outline-3">
<h3 id="Rustup_and_Cargo"><span class="section-number-3">3.2.</span> Rustup and Cargo</h3>
<div class="outline-text-3" id="text-3-2">
<p>
<a href="https://rustup.rs/">Rustup</a> is a tool that installs the latest versions of <a href="https://www.rust-lang.org/">Rust</a> and <a href="https://doc.rust-lang.org/cargo/">Cargo</a>
<i>in your home directory</i>. Cargo is a user-space source-package manager
for Rust programs and libraries. This config uses Cargo to install the
optional helper programs used by its modules. Once setup, any
user-space packages installed by Cargo are placed in <code>~/.cargo/bin</code>.
</p>
<p>
You may be able to find the <code>rustup</code> tool in your system package
manager and install it that way:
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell"><span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">e.g., on Fedora:</span>
sudo dnf install rustup
rustup-init
rustup component add rust-analyzer
</pre>
</div></div>
<p>
But you can also <a href="https://rustup.rs/">install it</a> the "curl bomb" way on most other systems:
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell">curl --proto <span style="color: #deb887;">'=https'</span> --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup component add rust-analyzer
</pre>
</div></div>
<p>
Cargo packages are declared by Emacs modules themselves:
</p>
<div class="code-block-container"><div class="code-block-header lang">(untangled) emacs-lisp</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">this example declares the "just" crate needs to be installed.</span>
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">(the actual install is deferred until later):</span>
(my/cargo-dependency <span style="color: #deb887;">"just"</span>)
</pre>
</div></div>
<p>
All of the crates are installed together <a href="#cargo-install-my-cargo-dependencies"><i>after</i> all of the modules
have been loaded</a>.
</p>
</div>
</div>
<div id="outline-container-Git" class="outline-3">
<h3 id="Git"><span class="section-number-3">3.3.</span> Git</h3>
<div class="outline-text-3" id="text-3-3">
<p>
Install <code>git</code> via your package manager:
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell"><span style="color: #7f7f7f;">#</span><span style="color: #7f7f7f;">e.g., Fedora:</span>
sudo dnf install git
</pre>
</div></div>
<p>
Clone this git repository:
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell">git clone https://github.com/EnigmaCurry/emacs.git <span style="color: #deb887;">\</span>
~/git/vendor/enigmacurry/emacs
</pre>
</div></div>
<p>
Switch to the right branch:
</p>
<pre class="example">
git checkout literate-new
</pre>
</div>
</div>
<div id="outline-container-Tree-sitter" class="outline-3">
<h3 id="Tree-sitter"><span class="section-number-3">3.4.</span> Tree-sitter</h3>
<div class="outline-text-3" id="text-3-4">
<p>
Tree-sitter is an optional dependency. It adds advanced syntax tree
parser to language modes.
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell"><span style="color: #7f7f7f;">#</span><span style="color: #7f7f7f;">on e.g., Fedora</span>
sudo dnf install libtree-sitter
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Create_your_Emacs_config_directory" class="outline-3">
<h3 id="Create_your_Emacs_config_directory"><span class="section-number-3">3.5.</span> Create your Emacs config directory</h3>
<div class="outline-text-3" id="text-3-5">
<p>
You can try this config out without modifying your existing config.
The following command tells Emacs to load config directly (ignoring
your existing config):
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell">emacs --init-directory ~/git/vendor/enigmacurry/emacs
</pre>
</div></div>
<p>
If you omit <code>--init-directory</code>, the default location Emacs looks for
your config is <code>~/.emacs.d</code>
</p>
<p>
To set this config as the default, symlink the git repository from
<code>~/.emacs.d</code> :
</p>
<div class="code-block-container"><div class="code-block-header shell">Run this in your shell ::</div>
<div class="org-src-container">
<pre class="src src-shell">ln -s ~/git/vendor/enigmacurry/emacs ~/.emacs.d
</pre>
</div></div>
<p>
Now when you run <code>emacs</code> with no arguments it will load the <code>init.el</code>
found in the git repository.
</p>
</div>
</div>
</div>
<div id="outline-container-Early_Init" class="outline-2">
<h2 id="Early_Init"><span class="section-number-2">4.</span> Early Init</h2>
<div class="outline-text-2" id="text-4">
<p>
The <a href="early-init.el">early-init.el</a> is the first config file that is loaded on
Emacs startup. It is used to set an initial visual look and feel
before the GUI is initialized, including an initial dark theme.
Additionally, early debug options are set here.
</p>
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">early-init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Load an initial theme (will be overriden later in modules/theme/theme.el)</span>
(load-theme 'modus-vivendi)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Set a larger default font size (150 = 15 pt size):</span>
(<span style="color: #00bfff;">setq</span> my/default-text-height 150)
(set-face-attribute 'default nil <span style="color: #f08080;">:height</span> my/default-text-height)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Turn off GUI distractions:</span>
(menu-bar-mode -1) <span style="color: #7f7f7f;">; </span><span style="color: #7f7f7f;">Press F10 to bring up the menu if you still need it.</span>
(tool-bar-mode -1)
(scroll-bar-mode -1)
(<span style="color: #00bfff;">setq</span> inhibit-startup-screen t)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Don't resize the frame when adjusting the font size:</span>
(<span style="color: #00bfff;">setq</span> window-resize-pixelwise t)
(<span style="color: #00bfff;">setq</span> frame-resize-pixelwise t)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Disable package.el in favor of straight.el</span>
(<span style="color: #00bfff;">setq</span> package-enable-at-startup nil)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Debug options:</span>
<span style="color: #7f7f7f;">;;; </span><span style="color: #7f7f7f;">Start Emacs with the `--debug-init` argument, to debug errors during startup.</span>
<span style="color: #7f7f7f;">;;; </span><span style="color: #7f7f7f;">Enter debugger on specific logger regex (see *Messages* buffer):</span>
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">(setq debug-on-message "Example log message to trace")</span>
<span style="color: #7f7f7f;">;;; </span><span style="color: #7f7f7f;">M-x toggle-debug-on-error</span>
(<span style="color: #00bfff;">setq</span> debug-on-error t)
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Base_config" class="outline-2">
<h2 id="Base_config"><span class="section-number-2">5.</span> Base config</h2>
<div class="outline-text-2" id="text-5">
<p>
This is the base config of <a href="init.el">init.el</a> which is loaded in all
environments. Only Emacs builtins will be allowed here:
</p>
</div>
<div id="outline-container-Core_libraries" class="outline-3">
<h3 id="Core_libraries"><span class="section-number-3">5.1.</span> Core libraries</h3>
<div class="outline-text-3" id="text-5-1">
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">core libraries</span>
(<span style="color: #00bfff;">require</span> '<span style="color: #a2cd5a;">cl-lib</span>)
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Nice_defaults" class="outline-3">
<h3 id="Nice_defaults"><span class="section-number-3">5.2.</span> Nice defaults</h3>
<div class="outline-text-3" id="text-5-2">
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Nice defaults</span>
(<span style="color: #00bfff;">setq-default</span> confirm-kill-emacs #'yes-or-no-p)
(<span style="color: #00bfff;">setq-default</span> vc-follow-symlinks t)
(<span style="color: #00bfff;">setq-default</span> indicate-empty-lines t)
(<span style="color: #00bfff;">setq-default</span> indicate-buffer-boundaries 'left)
(<span style="color: #00bfff;">setq-default</span> sentence-end-double-space nil)
(<span style="color: #00bfff;">setq-default</span> indent-tabs-mode nil)
(<span style="color: #00bfff;">setq-default</span> tab-width 4)
(<span style="color: #00bfff;">setq-default</span> visible-bell t)
(<span style="color: #00bfff;">setq-default</span> dired-listing-switches <span style="color: #deb887;">"-al --group-directories-first"</span>)
(<span style="color: #00bfff;">setq-default</span> tramp-default-method <span style="color: #deb887;">"ssh"</span>)
(<span style="color: #00bfff;">setq-default</span> native-comp-deferred-compilation-deny-list nil)
(<span style="color: #00bfff;">setq-default</span> browse-url-browser-function 'browse-url-firefox)
(put 'narrow-to-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Configure_file_backups_and_auto-saves" class="outline-3">
<h3 id="Configure_file_backups_and_auto-saves"><span class="section-number-3">5.3.</span> Configure file backups and auto-saves</h3>
<div class="outline-text-3" id="text-5-3">
<ul class="org-ul">
<li>Store file backups in <code>~/.emacs.d/backup</code> rather than being
littered everywhere else. Backups should store a file snapshot
before <i>every</i> save.</li>
<li>Store auto-saves in <code>~/.emacs.d/auto-save</code>. auto-saves helps you to
not to lose your work <i>before</i> you save, by automatically saving
idle buffers into the auto-save directory.</li>
</ul>
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Backups and auto-save</span>
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Reference: https://www.emacswiki.org/emacs/BackupDirectory</span>
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Reference: https://www.emacswiki.org/emacs/ForceBackups</span>
(<span style="color: #00bfff;">setq</span> backup-by-copying t)
(<span style="color: #00bfff;">setq</span> backup-directory-alist
`((<span style="color: #deb887;">"."</span> . ,(expand-file-name <span style="color: #deb887;">"backup"</span> user-emacs-directory))))
(<span style="color: #00bfff;">setq</span> delete-old-versions t)
(<span style="color: #00bfff;">setq</span> kept-new-versions 6)
(<span style="color: #00bfff;">setq</span> kept-old-versions 2)
(<span style="color: #00bfff;">setq</span> version-control t)
(<span style="color: #00bfff;">setq</span> vc-make-backup-files t)
(add-hook 'before-save-hook
(<span style="color: #00bfff;">lambda</span> () (<span style="color: #00bfff;">setq</span> buffer-backed-up nil)))
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">autosaves go in a separate directory</span>
(<span style="color: #00bfff;">let</span> ((auto-save-dir (expand-file-name <span style="color: #deb887;">"auto-save"</span> user-emacs-directory)))
(make-directory auto-save-dir t)
(<span style="color: #00bfff;">setq</span> auto-save-file-name-transforms
`((<span style="color: #deb887;">".*"</span> ,auto-save-dir t))))
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Customization" class="outline-3">
<h3 id="Customization"><span class="section-number-3">5.4.</span> Customization</h3>
<div class="outline-text-3" id="text-5-4">
<p>
Emacs has a powerful <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html">customization feature</a> and this configuration uses
it for all the user and machine specific settings.
</p>
<p>
Enter the interactive customization menu for this config: <code>M-x
my/custom-settings</code>
</p>
<p>
There are several sub-menus of settings for different modules. You can
change the values for any of the settings and then press <code>C-x C-s</code>
(custom-save), and it will save the custom values in
<code>~/.emacs.d/custom.el</code>. This file is ignored by the git repository,
and it is used to store persistent custom values for a specific
machine only.
</p>
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Store customizations in custom.el</span>
(<span style="color: #00bfff;">setq</span> custom-file (locate-user-emacs-file <span style="color: #deb887;">"custom.el"</span>))
(<span style="color: #00bfff;">when</span> (file-exists-p custom-file)
(load custom-file))
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Store all customizations under my/custom-settings group</span>
(<span style="color: #00bfff;">defgroup</span> <span style="color: #98f5ff;">my/custom-settings</span> nil
<span style="color: #ffe4b5;">"My custom Emacs settings"</span>
<span style="color: #f08080;">:group</span> 'emacs)
<span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Shortcut to open custom settings:</span>
(<span style="color: #00bfff;">defun</span> <span style="color: #daa520;">my/custom-settings</span> ()
<span style="color: #ffe4b5;">"Open the Emacs customization interface for my custom settings."</span>
(<span style="color: #00bfff;">interactive</span>)
(customize-group 'my/custom-settings))
(<span style="color: #00bfff;">defalias</span> '<span style="color: #daa520;">my/settings</span> 'my/custom-settings)
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Builtin_minor_modes_to_activate_everywhere" class="outline-3">
<h3 id="Builtin_minor_modes_to_activate_everywhere"><span class="section-number-3">5.5.</span> Builtin minor modes to activate everywhere</h3>
<div class="outline-text-3" id="text-5-5">
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Global minor modes</span>
(column-number-mode)
(save-place-mode t)
(savehist-mode t)
(recentf-mode t)
(electric-pair-mode t)
</pre>
</div></div>
</div>
</div>
<div id="outline-container-PATH_setup" class="outline-3">
<h3 id="PATH_setup"><span class="section-number-3">5.6.</span> PATH setup</h3>
<div class="outline-text-3" id="text-5-6">
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">init.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Function to add a directory to PATH and exec-path</span>
(<span style="color: #00bfff;">defun</span> <span style="color: #daa520;">my/add-exec-path</span> (dir)
<span style="color: #ffe4b5;">"Add DIR to the environment PATH and exec-path if not already present."</span>
(<span style="color: #00bfff;">unless</span> (member dir exec-path)
(setenv <span style="color: #deb887;">"PATH"</span> (concat dir path-separator (getenv <span style="color: #deb887;">"PATH"</span>)))
(add-to-list 'exec-path dir)))
</pre>
</div></div>
</div>
</div>
<div id="outline-container-Programming_mode" class="outline-3">
<h3 id="Programming_mode"><span class="section-number-3">5.7.</span> Programming mode</h3>
<div class="outline-text-3" id="text-5-7">
<div class="code-block-container"><div class="code-block-header tangle"><span class="org-parameter">:tangle</span> <span class="filename">modules/programming.el</span></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7f7f7f;">;; </span><span style="color: #7f7f7f;">Basic programming mode settings</span>
(<span style="color: #00bfff;">setq-default</span> display-fill-column-indicator-column 80)
(add-hook 'prog-mode-hook (<span style="color: #00bfff;">lambda</span> ()