Repository navigation
Expand file tree
/
Copy pathemacs.html
More file actions
3561 lines (3346 loc) · 316 KB
/
Copy pathemacs.html
File metadata and controls
3561 lines (3346 loc) · 316 KB
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>
<!-- 2026-04-04 Sat 06:09 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Emacs Configuration</title>
<meta name="author" content="ape" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/code-copy.css"/>
<link rel="stylesheet" type="text/css" href="src/readtheorg_theme/css/search.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/search.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/code-copy.js"></script>
</head>
<body>
<div id="content" class="content">
<h1 class="title">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="#org45e5d3f">System Dependent Variables</a></li>
<li><a href="#orgd5d7e95">Packages and Management</a>
<ul>
<li><a href="#orgcbba267">Auto-tangle to init file</a></li>
<li><a href="#org0bc9ac4">Package management</a></li>
<li><a href="#orgfb959b4"><span class="todo TODO">TODO</span> Pure-plus</a></li>
</ul>
</li>
<li><a href="#org88e2493">General Emacs</a>
<ul>
<li><a href="#orgef8bd96">UI Configurations</a>
<ul>
<li><a href="#org37bc9fa">Basic</a></li>
<li><a href="#org8aad270">Backup files</a></li>
<li><a href="#org07e1871">Transparency</a></li>
<li><a href="#orgc738ab6">Scrolling</a></li>
<li><a href="#orgd73cd68">Undo-tree</a></li>
<li><a href="#orgab19f01">Modeline</a></li>
<li><a href="#org5feb919">Auto-clean white space</a></li>
</ul>
</li>
<li><a href="#org8753821">Keybindings</a></li>
<li><a href="#orgd8f67a3">Dired</a></li>
<li><a href="#orgb84211a">Proced</a></li>
<li><a href="#org4e9b52d">Native Compilation</a></li>
<li><a href="#org69f9cd8"><span class="todo TODO">TODO</span> Goto last change</a></li>
<li><a href="#org6b0adad">Input Buffer, Directory Search</a>
<ul>
<li><a href="#org709ca92">Ivy, Ivy-Rich, and Counsel</a></li>
<li><a href="#orgc6e6a4a">Ivy-Rich</a></li>
<li><a href="#org4a95612">Ivy-prescient</a></li>
<li><a href="#orga09359a">Counsel</a></li>
</ul>
</li>
<li><a href="#org38d8581">Helpful and Which-key</a>
<ul>
<li><a href="#orgced1be4">Helpful</a></li>
<li><a href="#org07a87cd">Which-key</a></li>
</ul>
</li>
<li><a href="#org5d9c6d5">Font size</a></li>
<li><a href="#orgcf72707">General Helper Function</a>
<ul>
<li><a href="#orgf20d649">Quickly load init</a></li>
<li><a href="#orge513cd5">jmn-vscode-current-buffer-file-at-point</a></li>
<li><a href="#org6d5629f">jmn-remove-M-1-9-from-mode-map</a></li>
<li><a href="#org6b7dd2e">Remove use-package s-expressions</a></li>
</ul>
</li>
<li><a href="#org48c0349">Emacs in the terminal</a></li>
<li><a href="#org889608c">MISC</a>
<ul>
<li><a href="#org01417f4">Async-shell-command</a></li>
<li><a href="#org8b3c941"></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgdd25838">General Development</a>
<ul>
<li><a href="#org37e8e2a">Indentation</a></li>
<li><a href="#org393d379">Prog-mode</a></li>
<li><a href="#orgd25de1a">Parens/delimiters</a>
<ul>
<li><a href="#org7fd9880"><span class="todo TODO">TODO</span> Rainbow Delimiters</a></li>
<li><a href="#org9b82594">Smartparens</a></li>
</ul>
</li>
<li><a href="#org4f64f56">Magit</a></li>
<li><a href="#org1ab3a06"><span class="todo TODO">TODO</span> Git-Gutter</a></li>
<li><a href="#orgfff2fdd">Highlight-indent-guide</a></li>
<li><a href="#org34db33e">Company-Mode</a>
<ul>
<li><a href="#org5f4d33d">company-box-mode</a></li>
<li><a href="#orga3c67ef">company-prescient</a></li>
</ul>
</li>
<li><a href="#org35ac7ac">Treemacs</a></li>
<li><a href="#org439519c">Eglot</a></li>
<li><a href="#org6e35c57">Breadcrumb</a></li>
<li><a href="#orgc999d7a">CMake</a>
<ul>
<li><a href="#org88b145a">CMake-mode</a></li>
<li><a href="#orgc7930fe"><span class="todo TODO">TODO</span> CMake project</a></li>
</ul>
</li>
<li><a href="#org0e59e73">Yasnippet</a></li>
<li><a href="#org360674c"><span class="todo TODO">TODO</span> Flyspell</a></li>
<li><a href="#org24297e0">Evil nerd commenter</a></li>
<li><a href="#org831f8f4">Tree Sitter Highlighting</a></li>
<li><a href="#org4e6d781">Ripgrep</a></li>
<li><a href="#orgd9d909f">YAML</a></li>
<li><a href="#org2dec8ad">TOML</a></li>
<li><a href="#orga8890bf">Docker</a></li>
<li><a href="#orgd83a4fe"><span class="todo TODO">TODO</span> Compilation mode in async output</a></li>
<li><a href="#org559088d">Devdocs</a></li>
<li><a href="#orgd2efeec">Pure Dev Tools</a>
<ul>
<li><a href="#org0ac621c">smerge</a></li>
<li><a href="#org2decdde">Tab completion</a></li>
<li><a href="#orgc8daded">vc-mode</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org603ddf9">Languages</a>
<ul>
<li><a href="#org05d0262">Emacs-lisp</a></li>
<li><a href="#orgf69a033">Bash</a></li>
<li><a href="#org87a7825">Python</a>
<ul>
<li><a href="#org949c28b">Pyvenv</a></li>
<li><a href="#orgc37177d">Python-mode</a></li>
<li><a href="#org7c35686">Hook</a></li>
</ul>
</li>
<li><a href="#org173eef8">C/C++</a>
<ul>
<li><a href="#orga017a73">Compilation Buffer</a></li>
<li><a href="#orgd1b0a61">Hook</a></li>
</ul>
</li>
<li><a href="#orge652fea">Octave</a></li>
<li><a href="#org1f379a3">Markdown</a></li>
<li><a href="#orga23d686"><span class="todo TODO">TODO</span> Haskell</a>
<ul>
<li><a href="#org576acaf">1) Install GHCup</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org20eb357">Org-Mode</a>
<ul>
<li><a href="#org5d9c6bd">Mode setup</a></li>
<li><a href="#org2b45326">Fonts</a></li>
<li><a href="#org181a9d2">Start</a></li>
<li><a href="#org10ae3fb">Bullets</a></li>
<li><a href="#org7cd3de0">Center column and line wrapping</a></li>
<li><a href="#orge29c148">Org-babel</a></li>
<li><a href="#org990331c">Inline latex</a>
<ul>
<li><a href="#orgf2d384e">Set in-line LaTeX's relative font size</a></li>
<li><a href="#orga149d52">In-line LaTeX size when buffer scale is changed</a></li>
<li><a href="#org8f420d6">org-fragtog</a></li>
</ul>
</li>
<li><a href="#org9cc67a8">Keybindings</a></li>
<li><a href="#orgf906fd2">HTML</a>
<ul>
<li><a href="#org63f977d">htmlize</a></li>
<li><a href="#org8a7bbeb">Save to HTML on save</a></li>
<li><a href="#org298e219">Make Read The Org setup file safe</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org138fbde">Agenda and GTD</a>
<ul>
<li><a href="#org490da6e">General</a>
<ul>
<li><a href="#org71fa881">hook</a></li>
</ul>
</li>
<li><a href="#org48e0a34">Habits</a></li>
<li><a href="#orgf7c12ea">Capture Templates</a></li>
<li><a href="#org80b59f1">Archive</a></li>
<li><a href="#org452ed24">Process Inbox Item</a></li>
<li><a href="#org76c162c">Advice</a></li>
<li><a href="#org9349b21">Keybindings</a></li>
</ul>
</li>
<li><a href="#org581584f">Terminals</a>
<ul>
<li><a href="#orgbbaa159">term-mode</a>
<ul>
<li><a href="#org8e1e47f">Keybindings</a></li>
<li><a href="#org13c11eb">Better term-mode colors</a></li>
<li><a href="#org15b8ffd">Version 26.1</a></li>
</ul>
</li>
<li><a href="#org2ae0d49">vterm</a></li>
</ul>
</li>
<li><a href="#org5c4addb">Theme and Frame</a>
<ul>
<li><a href="#org03c535a">Setup and helpers</a></li>
<li><a href="#org51d319f">Gruvbox and Modifications</a>
<ul>
<li><a href="#orgaa877d0">Modify Themes</a></li>
<li><a href="#orga524265">Loading functions</a></li>
</ul>
</li>
<li><a href="#orgcd9d9ab">Pure Themes</a>
<ul>
<li><a href="#orgb072b78">Modifying Themes</a></li>
<li><a href="#org249732a">Loading functions</a></li>
</ul>
</li>
<li><a href="#org657da4d">Startup Theme switches</a></li>
<li><a href="#org1741eb9">Frame Height</a></li>
</ul>
</li>
<li><a href="#org4fde3b8">Shell Backend and Windows Core Setup</a>
<ul>
<li><a href="#orgfc88017"><span class="todo TODO">TODO</span> Linux</a></li>
<li><a href="#orgf6234fa">Windows</a></li>
</ul>
</li>
<li><a href="#org14470bd">Hacky Fixes</a>
<ul>
<li><a href="#orgc806889">Corrects error: File mode specification error: (error Invalid image type ‘svg’) (not used)</a></li>
<li><a href="#org34dcddb">Keep transparency when toggling to full-screen in Emacs 29+</a></li>
<li><a href="#orgf625b52">Transparency in term (<code>emacs -nw</code>)</a></li>
<li><a href="#org7c269b4">Org LaTeX Preview</a></li>
<li><a href="#orge4fe54b">Setting Org-figures width</a></li>
<li><a href="#org7d73278">Set certain file extensions to read only buffer</a></li>
<li><a href="#org629349d">Set certain file extensions to display line numbers</a></li>
</ul>
</li>
<li><a href="#org7c4a8a3">Startup and Tabs</a>
<ul>
<li><a href="#org2b7e269">Recentf</a></li>
<li><a href="#org4068a78">Tabs</a></li>
<li><a href="#orgec25b66">Dashboard</a></li>
</ul>
</li>
<li><a href="#org58e2054">Recreation</a>
<ul>
<li><a href="#orgd0e7fae">Hacker News Reader</a></li>
</ul>
</li>
<li><a href="#orgdecbd64">gptel</a></li>
</ul>
</div>
</div>
<div id="outline-container-org45e5d3f" class="outline-2">
<h2 id="org45e5d3f">System Dependent Variables</h2>
<div class="outline-text-2" id="text-org45e5d3f">
<p>
Hopefully only need to change these to get setup on a new machine.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-config-location</span> <span style="color: #b8bb26;">"~/dotfiles/emacs.org"</span>
<span style="color: #b8bb26;">"Location of literate org file used to automaitically tangle to init.el"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">let</span> <span style="color: #b16286;">(</span><span style="color: #8ec07c;">(</span>gtd-path '<span style="color: #d65d0e;">(</span><span style="color: #458588;">(</span>gnu/linux . <span style="color: #b8bb26;">"~/Documents/gtd/"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>windows-nt . <span style="color: #b8bb26;">"c:/Users/nehlsj/OneDrive/Documents/gtd/"</span><span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-gtd-directory</span> <span style="color: #8ec07c;">(</span>alist-get system-type gtd-path<span style="color: #8ec07c;">)</span>
<span style="color: #b8bb26;">"Location of gtd org files: projects, inbox, next, whip, journal, and habits"</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-connected-systems</span> '<span style="color: #b16286;">(</span><span style="color: #b8bb26;">"lat"</span> <span style="color: #b8bb26;">"dsk"</span> <span style="color: #b8bb26;">"xps"</span><span style="color: #b16286;">)</span>
<span style="color: #b8bb26;">"Systems which should download packages. Others get the '</span><span style="color: #d3869b;">pure</span><span style="color: #b8bb26;">' configuration."</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-connected-extras</span> t
<span style="color: #b8bb26;">"Flag of weather to use the purely astetic packages or not on connected system"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-pureplus-systems</span> '<span style="color: #b16286;">(</span><span style="color: #b8bb26;">"lat"</span> <span style="color: #b8bb26;">"testbed"</span><span style="color: #b16286;">)</span>
<span style="color: #b8bb26;">"Systems which use the pure setup with the plus packages"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-dark-mode</span> t
<span style="color: #b8bb26;">"Do we want Emacs in a dark mode? Note: no dark-mode for windows as of now"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-font-height-alist</span> '<span style="color: #b16286;">(</span><span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"xps"</span> . 110<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"dsk"</span> . 110<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"lat"</span> . 115<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b8bb26;">"Set text-hight for each machine-- default will be 100"</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd5d7e95" class="outline-2">
<h2 id="orgd5d7e95">Packages and Management</h2>
<div class="outline-text-2" id="text-orgd5d7e95">
</div>
<div id="outline-container-orgcbba267" class="outline-3">
<h3 id="orgcbba267">Auto-tangle to init file</h3>
<div class="outline-text-3" id="text-orgcbba267">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Automatically tangle our Emacs.org config file when we save it</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">efs/org-babel-tangle-config</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">when</span> <span style="color: #8ec07c;">(</span>string-equal <span style="color: #d65d0e;">(</span>buffer-file-name<span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>expand-file-name jmn-config-location<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Dynamic scoping to the rescue</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">let</span> <span style="color: #d65d0e;">(</span><span style="color: #458588;">(</span>org-confirm-babel-evaluate nil<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>org-babel-tangle<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>add-hook 'org-mode-hook
<span style="color: #b16286;">(</span><span style="color: #fb4933;">lambda</span> <span style="color: #8ec07c;">()</span> <span style="color: #8ec07c;">(</span>add-hook 'after-save-hook #'efs/org-babel-tangle-config<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0bc9ac4" class="outline-3">
<h3 id="org0bc9ac4">Package management</h3>
<div class="outline-text-3" id="text-org0bc9ac4">
<p>
Archives: elpa is default, melpa is community.
</p>
<ul class="org-ul">
<li>Use-package is macro that is used like a package manager. <a href="https://github.com/jwiegley/use-package">Use-Package Documentation</a></li>
<li>Update all packages with <code>M-x package-upgrade-all</code></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> <span style="color: #b16286;">(</span>member system-name jmn-connected-systems<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-pure</span> nil <span style="color: #b8bb26;">"Indicating if we are pure or using packages"</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">if</span> <span style="color: #8ec07c;">(</span>member system-name jmn-pureplus-systems<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-pure</span> <span style="color: #b8bb26;">"plus"</span> <span style="color: #b8bb26;">"Indicating we are using pure config with plus packages"</span><span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-pure</span> t <span style="color: #b8bb26;">"Indicating if we are pure, not using any packages"</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">flag</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defconst</span> <span style="color: #83a598;">jmn-term</span> <span style="color: #b16286;">(</span>not <span style="color: #8ec07c;">(</span>display-graphic-p <span style="color: #d65d0e;">(</span>selected-frame<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b8bb26;">"Indicating if emacs is being run within a terminal or not"</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-connect-to-repositories</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">require</span> '<span style="color: #d3869b;">package</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> package-archives '<span style="color: #8ec07c;">(</span><span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"melpa"</span> . <span style="color: #b8bb26;">"https://melpa.org/packages/"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"elpa"</span> . <span style="color: #b8bb26;">"https://elpa.gnu.org/packages/"</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">if</span> <span style="color: #8ec07c;">(</span>version< emacs-version <span style="color: #b8bb26;">"29"</span><span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">progn</span>
<span style="color: #d65d0e;">(</span><span style="color: #fb4933;">setq</span> package-check-signature nil<span style="color: #d65d0e;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">bugfix: keys are not installed</span>
<span style="color: #d65d0e;">(</span><span style="color: #fb4933;">setq</span> gnutls-algorithm-priority <span style="color: #b8bb26;">"NORMAL:-VERS-TLS1.3"</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">to load melpa</span>
<span style="color: #b16286;">(</span>package-initialize<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">unless</span> package-archive-contents
<span style="color: #8ec07c;">(</span>package-refresh-contents<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">unless</span> <span style="color: #8ec07c;">(</span>package-installed-p 'use-package<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>package-install 'use-package<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Initialize use-package on non-Linux platforms</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">require</span> '<span style="color: #d3869b;">use-package</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> use-package-always-ensure t<span style="color: #b16286;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">no need for :ensure t for each package.</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> use-package-verbose t<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">log configure/loading messages in *Messages*</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> jmn-pure
<span style="color: #b16286;">(</span><span style="color: #fb4933;">defmacro</span> <span style="color: #fabd2f;">use-package</span> <span style="color: #8ec07c;">(</span><span style="color: #d3869b;">&rest</span> _<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">define use-package macro to do nothing</span>
<span style="color: #b16286;">(</span>jmn-connect-to-repositories<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">connect to repos and use use-package macros to config below</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgfb959b4" class="outline-3">
<h3 id="orgfb959b4"><span class="todo TODO">TODO</span> Pure-plus</h3>
<div class="outline-text-3" id="text-orgfb959b4">
<p>
Code above is for pure (offline) and non-pure (online). The below is for a pure = 'plus', when we include a few packages.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-install-plus-packages</span><span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>jmn-connect-to-repositories<span style="color: #b16286;">)</span>
<span style="color: #7c6f64;">;;</span><span style="color: #7c6f64;">install for all versions</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">dolist</span> <span style="color: #8ec07c;">(</span>pluslist '<span style="color: #d65d0e;">(</span>which-key undo-tree ws-butler prescient ivy ivy-rich ivy-prescient counsel htmlize evil-nerd-commenter<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>package-install pluslist 1<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">install if version 27 and above</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">if</span> <span style="color: #8ec07c;">(</span>version<= <span style="color: #b8bb26;">"27"</span> emacs-version<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">progn</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">For emacs 28</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">magit requires ver >= 2.24 which is greater than built in version</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Warnings buffer gives the following advice</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">TODO -- need it install seq-2.24 by hand in package-list-packages</span>
<span style="color: #d65d0e;">(</span><span style="color: #fb4933;">setq</span> package-install-upgrade-built-in t<span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #fb4933;">dolist</span> <span style="color: #458588;">(</span>pluslist '<span style="color: #b16286;">(</span>seq magit markdown-mode<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>package-install pluslist 1<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>unload-feature 'seq t<span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #fb4933;">require</span> '<span style="color: #d3869b;">seq</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
<p>
If it fails here, we need to add the packages to <code>~/.emacs.d/elpa</code>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> <span style="color: #b16286;">(</span>string= jmn-pure <span style="color: #b8bb26;">"plus"</span><span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">turn on all of the plus modes</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">progn</span>
<span style="color: #8ec07c;">(</span>package-initialize<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">require</span> '<span style="color: #d3869b;">prescient</span><span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">dolist</span> <span style="color: #d65d0e;">(</span>pluslist '<span style="color: #458588;">(</span>which-key-mode undo-tree-mode ws-butler-mode prescient-persist-mode ivy-mode ivy-rich-mode ivy-prescient-mode counsel-mode<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>funcall pluslist 1<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">evil nerd commenter</span>
<span style="color: #8ec07c;">(</span>global-set-key <span style="color: #d65d0e;">(</span>kbd <span style="color: #b8bb26;">"C-;"</span><span style="color: #d65d0e;">)</span> 'evilnc-comment-or-uncomment-lines<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
<p>
TODO can the above do list be replaced with <code>(package-initialize)</code>?
</p>
</div>
</div>
</div>
<div id="outline-container-org88e2493" class="outline-2">
<h2 id="org88e2493">General Emacs</h2>
<div class="outline-text-2" id="text-org88e2493">
</div>
<div id="outline-container-orgef8bd96" class="outline-3">
<h3 id="orgef8bd96">UI Configurations</h3>
<div class="outline-text-3" id="text-orgef8bd96">
</div>
<div id="outline-container-org37bc9fa" class="outline-4">
<h4 id="org37bc9fa">Basic</h4>
<div class="outline-text-4" id="text-org37bc9fa">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Basic ;;;;</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> inhibit-startup-message t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">inhibit startup message</span>
<span style="color: #458588;">(</span>tool-bar-mode -1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">remove toolbar</span>
<span style="color: #458588;">(</span>menu-bar-mode -1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Disable the menu bar</span>
<span style="color: #458588;">(</span>scroll-bar-mode -1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">remove side scrollbar</span>
<span style="color: #458588;">(</span>tooltip-mode -1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Disable tooltips</span>
<span style="color: #458588;">(</span>set-fringe-mode 6<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Give some breathing room</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> visible-bell t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Set up the visible bell</span>
<span style="color: #458588;">(</span>save-place-mode 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Open file where last visited</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> Buffer-menu-name-width 35<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">give name more room</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq-default</span> indicate-empty-lines t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">indicate long lines</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defalias</span> '<span style="color: #fabd2f;">yes-or-no-p</span> 'y-or-n-p<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">Make =yes or no= prompts shorter</span>
<span style="color: #458588;">(</span>column-number-mode 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">show column number in modeline</span>
<span style="color: #458588;">(</span>winner-mode 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">redo and undo window changes</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> <span style="color: #b16286;">(</span>version<= <span style="color: #b8bb26;">"28"</span> emacs-version<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>repeat-mode 1<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">multi-key sequences can be repeated</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">hooks</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">This modifies too much and makes git/diffs difficult-- need to find better solution</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(if jmn-pure</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(add-hook 'before-save-hook 'whitespace-cleanup)); non-pure uses ws-butler</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">unless</span> <span style="color: #b16286;">(</span>eq system-type 'windows-nt<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>add-hook 'text-mode-hook 'flyspell-mode<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">enable spellcheck on text mode</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">The following help syncing</span>
<span style="color: #458588;">(</span>global-auto-revert-mode 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">refresh buffer if changed on disk</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> auto-revert-use-notify nil<span style="color: #458588;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">don't notify?</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> auto-revert-verbose nil<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Mouse</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> mouse-yank-at-point t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">yank at cursor not click location</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">By default Emacs prefers `</span><span style="color: #d3869b;">.elc</span><span style="color: #7c6f64;">' to `</span><span style="color: #d3869b;">.el</span><span style="color: #7c6f64;">' in all cases, `</span><span style="color: #d3869b;">load-prefer-newer</span><span style="color: #7c6f64;">'s</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">alway prefers the last-edited file, preventing this problem.</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> load-prefer-newer t<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Buffer Menu</span>
<span style="color: #458588;">(</span>add-hook 'Buffer-menu-mode-hook 'hl-line-mode<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>add-hook 'bookmark-bmenu-mode-hook 'hl-line-mode<span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org8aad270" class="outline-4">
<h4 id="org8aad270">Backup files</h4>
<div class="outline-text-4" id="text-org8aad270">
<p>
Save backups in <code>.emacs.d</code>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> backup-directory-alist
'<span style="color: #b16286;">(</span> <span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"."</span> . <span style="color: #b8bb26;">"~/.emacs.d/filebackups"</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org07e1871" class="outline-4">
<h4 id="org07e1871">Transparency</h4>
<div class="outline-text-4" id="text-org07e1871">
<p>
Set transparency
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">transparency</span> <span style="color: #b16286;">(</span>value<span style="color: #b16286;">)</span>
<span style="color: #b8bb26;">"Sets the transparency of the frame window. 0=transparent/100=opaque"</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span> <span style="color: #b8bb26;">"nTransparency Value 0 - 100 opaque:"</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">if</span> <span style="color: #8ec07c;">(</span>version<= <span style="color: #b8bb26;">"29"</span> emacs-version<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>set-frame-parameter nil 'alpha-background value<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>set-frame-parameter <span style="color: #d65d0e;">(</span>selected-frame<span style="color: #d65d0e;">)</span> 'alpha value<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc738ab6" class="outline-4">
<h4 id="orgc738ab6">Scrolling</h4>
<div class="outline-text-4" id="text-orgc738ab6">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Scrolling ;;;;</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Fully redraw the display before it processes queued input events.</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> redisplay-dont-pause t<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Number of lines of continuity to retain when scrolling by full screens</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> next-screen-context-lines 2<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">golden ration pkg will replaced this if loaded</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">only '</span><span style="color: #d3869b;">jump</span><span style="color: #7c6f64;">' when moving this far off the screen</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> scroll-conservatively 100<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> scroll-step 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Keyboard scroll one line at a time</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> mouse-wheel-progressive-speed nil<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Don't accelerate scrolling</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> mouse-wheel-follow-mouse t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Scroll window under mouse</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> fast-but-imprecise-scrolling t<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">No (setq less) lag while scrolling lots.</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> auto-window-vscroll nil<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Cursor move faster</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> pixel-scroll-precision-mode 1<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">pixel based scrolling</span>
</pre>
</div>
</div>
<ul class="org-ul">
<li><a id="orgad92b36"></a>Fast Scroll<br />
<div class="outline-text-5" id="text-orgad92b36">
<p>
To ensure scrolling is fast in Emacs, disable non-essential things while the window is being scrolled:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> fast-scroll
<span style="color: #fe8019;">:defer</span> 2
<span style="color: #fe8019;">:config</span>
<span style="color: #b16286;">(</span>add-hook 'fast-scroll-start-hook <span style="color: #8ec07c;">(</span><span style="color: #fb4933;">lambda</span> <span style="color: #d65d0e;">()</span> <span style="color: #d65d0e;">(</span>flycheck-mode -1<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>add-hook 'fast-scroll-end-hook <span style="color: #8ec07c;">(</span><span style="color: #fb4933;">lambda</span> <span style="color: #d65d0e;">()</span> <span style="color: #d65d0e;">(</span>flycheck-mode 1<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>fast-scroll-config<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>fast-scroll-mode 1<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</li>
</ul>
</div>
<div id="outline-container-orgd73cd68" class="outline-4">
<h4 id="orgd73cd68">Undo-tree</h4>
<div class="outline-text-4" id="text-orgd73cd68">
<ul class="org-ul">
<li><code>C-x u</code> visualizes undo history as a tree for easy navigation</li>
<li><code>C-_</code> undo</li>
<li><code>M-_</code> redo
Archive: elpa</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> undo-tree
<span style="color: #fe8019;">:defer</span> 2
<span style="color: #fe8019;">:config</span>
<span style="color: #b16286;">(</span>global-undo-tree-mode 1<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> undo-tree-auto-save-history nil<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">don't save ~undo-tree~ file</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgab19f01" class="outline-4">
<h4 id="orgab19f01">Modeline</h4>
<div class="outline-text-4" id="text-orgab19f01">
<p>
<b>NOTE</b>: The first time you load your configuration on a new machine, you’ll need to run <code>M-x all-the-icons-install-fonts</code> so that mode line icons display correctly. (Fixed?)
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"> <span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Modeline ;;;;</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> jmn-connected-extras
<span style="color: #b16286;">(</span><span style="color: #fb4933;">use-package</span> all-the-icons
<span style="color: #fe8019;">:defer</span> 1
<span style="color: #fe8019;">:init</span>
<span style="color: #8ec07c;">(</span><span style="color: #fb4933;">when</span> <span style="color: #d65d0e;">(</span><span style="color: #fb4933;">and</span> <span style="color: #458588;">(</span>not <span style="color: #b16286;">(</span>member <span style="color: #b8bb26;">"all-the-icons"</span> <span style="color: #8ec07c;">(</span>font-family-list<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">autoinstall fonts</span>
<span style="color: #458588;">(</span>window-system<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span>all-the-icons-install-fonts t<span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> doom-modeline
<span style="color: #fe8019;">:init</span> <span style="color: #b16286;">(</span>doom-modeline-mode 1<span style="color: #b16286;">)</span>
<span style="color: #fe8019;">:custom</span> <span style="color: #b16286;">(</span><span style="color: #8ec07c;">(</span>doom-modeline-height 10<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>doom-modeline-vcs-max-length 20<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">default is 12</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5feb919" class="outline-4">
<h4 id="org5feb919">Auto-clean white space</h4>
<div class="outline-text-4" id="text-org5feb919">
<p>
Archive: melpa
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Cleanup whitespace only on lines I touched ;;;;</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> ws-butler
<span style="color: #fe8019;">:defer</span> 4
<span style="color: #fe8019;">:hook</span> <span style="color: #b16286;">(</span><span style="color: #8ec07c;">(</span>text-mode . ws-butler-mode<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>prog-mode . ws-butler-mode<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org8753821" class="outline-3">
<h3 id="org8753821">Keybindings</h3>
<div class="outline-text-3" id="text-org8753821">
<ul class="org-ul">
<li>Eventually I will assume <code>repeat-mode</code> is builtin and remove the <code>C-o</code> bindings to <code>'other-window</code>
<ul class="org-ul">
<li>repeat mode is built in starting in Emacs 28</li>
</ul></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">general improvements</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"<escape>"</span><span style="color: #b16286;">)</span> 'keyboard-escape-quit<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-x C-b"</span><span style="color: #b16286;">)</span> 'buffer-menu<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">open buffer menue in current buffer</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-x C-k"</span><span style="color: #b16286;">)</span> 'kill-current-buffer<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">"C-x k" asks which buffer</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #b16286;">)</span> 'other-window<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">default is "C-x o"</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"M-o"</span><span style="color: #b16286;">)</span> 'previous-multiframe-window<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-c C-c"</span><span style="color: #b16286;">)</span> 'eval-buffer<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-c C-r"</span><span style="color: #b16286;">)</span> 'eval-region<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">make font bigger/smaller.</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-="</span><span style="color: #b16286;">)</span> 'text-scale-increase<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C--"</span><span style="color: #b16286;">)</span> 'text-scale-decrease<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-0"</span><span style="color: #b16286;">)</span> 'text-scale-adjust<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f1 is a leader key for help</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f2 is a leader key for 2 columns</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f3 is kmacro-start-macro-or-insert-counter -- start recording a macro</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f4 ends the macro recording</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f5-f10 are clear by default</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f11 is toggle full screen</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">f12 is clear by default</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">See recentfiles</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"<f5>"</span><span style="color: #b16286;">)</span> 'compile<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">See recentfiles</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"<f6>"</span><span style="color: #b16286;">)</span> 'recentf-open-files<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">writing/editing</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"<f9>"</span><span style="color: #b16286;">)</span> 'ispell-word<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"<f10>"</span><span style="color: #b16286;">)</span> 'dictionary-lookup-definition<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Buffer-menu-mode</span>
<span style="color: #458588;">(</span>define-key Buffer-menu-mode-map <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #b16286;">)</span> 'other-window<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>define-key Buffer-menu-mode-map <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"M-o"</span><span style="color: #b16286;">)</span> 'previous-multiframe-window<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">"o" opens in another buffer and moves focus</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">"C-M-o" opens in another buffer and keeps focus in the Buffer-menu</span>
<span style="color: #458588;">(</span>define-key Buffer-menu-mode-map <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-M-o"</span><span style="color: #b16286;">)</span> 'Buffer-menu-switch-other-window<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">xref</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">with-eval-after-load</span> 'xref
<span style="color: #b16286;">(</span>define-key xref--xref-buffer-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #8ec07c;">)</span> 'other-window<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key xref--xref-buffer-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"o"</span><span style="color: #8ec07c;">)</span> 'xref-show-location-at-point<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">bookmark-bmenue</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">with-eval-after-load</span> 'bookmark
<span style="color: #b16286;">(</span>define-key bookmark-bmenu-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #8ec07c;">)</span> 'other-window<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key bookmark-bmenu-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"M-o"</span><span style="color: #8ec07c;">)</span> 'previous-multiframe-window<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key bookmark-bmenu-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-M-o"</span><span style="color: #8ec07c;">)</span> 'bookmark-bmenu-switch-other-window<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">compilation-modes</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-compilation-keybindings</span><span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span>define-key compilation-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #8ec07c;">)</span> 'other-window<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key compilation-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-M-o"</span><span style="color: #8ec07c;">)</span> 'compilation-display-error<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>add-hook 'compilation-mode-hook 'jmn-compilation-keybindings<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">grep-mode</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-grep-keybindings</span><span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span>define-key grep-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"o"</span><span style="color: #8ec07c;">)</span> 'compilation-display-error<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key grep-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #8ec07c;">)</span> 'other-window<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>add-hook 'grep-mode-hook #'jmn-grep-keybindings<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">adjust windows with keybindings</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-<up>"</span><span style="color: #b16286;">)</span> 'enlarge-window<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-<down>"</span><span style="color: #b16286;">)</span> 'shrink-window<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-<right>"</span><span style="color: #b16286;">)</span> 'enlarge-window-horizontally<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-<left>"</span><span style="color: #b16286;">)</span> 'shrink-window-horizontally<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">non-org C-c <blank> bindings</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-c r"</span><span style="color: #b16286;">)</span> 'revert-buffer<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>global-set-key <span style="color: #b16286;">(</span>kbd <span style="color: #b8bb26;">"C-c ="</span><span style="color: #b16286;">)</span> 'vc-diff<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">also bound to "C-x v ="</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd8f67a3" class="outline-3">
<h3 id="orgd8f67a3">Dired</h3>
<div class="outline-text-3" id="text-orgd8f67a3">
<p>
More to do at <a href="https://youtu.be/PMWwM8QJAtU">here</a>: dired-open
</p>
<ul class="org-ul">
<li>"W" will open file in native environment (including another Emacs)</li>
<li>"(" toggle file info</li>
<li>M-x du shows the size of the files in the buffer (toggle for human readable)</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Dired ;;;;</span>
<span style="color: #458588;">(</span>add-hook 'dired-mode-hook 'dired-hide-details-mode<span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">hide default -- '(' to toggle</span>
<span style="color: #458588;">(</span>add-hook 'dired-mode-hook 'hl-line-mode<span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">with-eval-after-load</span> 'dired
<span style="color: #b16286;">(</span><span style="color: #fb4933;">require</span> '<span style="color: #d3869b;">dired-x</span><span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">may need to be (load "dired-x" for old versions</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> dired-auto-revert-buffer t<span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">auto-revert dired when revisiting</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> dired-vc-rename-file t<span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">renamed files are under version control</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">good for my persional machine</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(setq dired-listing-switches "-agho --group-directories-first" )</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">good as a user of</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> dired-listing-switches <span style="color: #b8bb26;">"-alh --group-directories-first"</span> <span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> find-ls-option '<span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"-print0 | xargs -0 ls -agho"</span> . <span style="color: #b8bb26;">""</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> dired-dwim-target t<span style="color: #b16286;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">guess other dired directory for copy and rename</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> wdired-allow-to-change-permissions t<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>define-key dired-mode-map <span style="color: #8ec07c;">(</span>kbd <span style="color: #b8bb26;">"C-o"</span><span style="color: #8ec07c;">)</span> 'other-window<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> dired-guess-shell-alist-user '<span style="color: #8ec07c;">(</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.png\\'"</span> <span style="color: #b8bb26;">"shotwell"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.jpg\\'"</span> <span style="color: #b8bb26;">"shotwell"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.jpeg\\'"</span> <span style="color: #b8bb26;">"shotwell"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.mp4\\'"</span> <span style="color: #b8bb26;">"vlc"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.avi\\'"</span> <span style="color: #b8bb26;">"vlc"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.iso\\'"</span> <span style="color: #b8bb26;">"vlc"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.webm\\'"</span> <span style="color: #b8bb26;">"vlc"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.mkv\\'"</span> <span style="color: #b8bb26;">"vlc"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.odt\\'"</span> <span style="color: #b8bb26;">"libreoffice"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.docx\\'"</span> <span style="color: #b8bb26;">"libreoffice"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.mp3\\'"</span> <span style="color: #b8bb26;">"rhythmbox"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.html\\'"</span> <span style="color: #b8bb26;">"firefox"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.epub\\'"</span> <span style="color: #b8bb26;">"ebook-viewer"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.pdf\\'"</span> <span style="color: #b8bb26;">"evince"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.ipynb\\'"</span> <span style="color: #b8bb26;">"code"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.py\\'"</span> <span style="color: #b8bb26;">"python"</span><span style="color: #d65d0e;">)</span>
<span style="color: #d65d0e;">(</span><span style="color: #b8bb26;">"\\.sh\\'"</span> <span style="color: #b8bb26;">"bash"</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span>
<span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">maybe use again in the future -- does not align with pure emacs</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(if (version<= "28" emacs-version)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(setf dired-kill-when-opening-new-dired-buffer t))</span>
<span style="color: #458588;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">use a single dired session ;; needed for emacs version < 28</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(use-package dired-single</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">:after dired</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">:defer t</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">:hook (dired-mode .</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(lambda () (define-key dired-mode-map [remap dired-find-file]</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">'dired-single-buffer)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(define-key dired-mode-map</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">[remap dired-mouse-find-file-other-window]</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">'dired-single-buffer-mouse)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">(define-key dired-mode-map [remap dired-up-directory]</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">'dired-single-up-directory))))</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">if</span> jmn-connected-extras
<span style="color: #b16286;">(</span><span style="color: #fb4933;">use-package</span> all-the-icons-dired
<span style="color: #fe8019;">:after</span> dired
<span style="color: #fe8019;">:defer</span> t
<span style="color: #fe8019;">:hook</span> <span style="color: #8ec07c;">(</span>dired-mode . all-the-icons-dired-mode<span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb84211a" class="outline-3">
<h3 id="orgb84211a">Proced</h3>
<div class="outline-text-3" id="text-orgb84211a">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Proced ;;;;</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">proced-settings</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span>proced-toggle-auto-update 5<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">auto update every 4 seconds</span>
<span style="color: #458588;">(</span>add-hook 'proced-mode-hook 'proced-settings<span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org4e9b52d" class="outline-3">
<h3 id="org4e9b52d">Native Compilation</h3>
<div class="outline-text-3" id="text-org4e9b52d">
<p>
Suppress compilation warnings
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #7c6f64;">;;;; </span><span style="color: #7c6f64;">Native comp ;;;;</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> native-comp-async-report-warnings-errors nil<span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org69f9cd8" class="outline-3">
<h3 id="org69f9cd8"><span class="todo TODO">TODO</span> Goto last change</h3>
<div class="outline-text-3" id="text-org69f9cd8">
<p>
Check with other environments to settle on "C-;" or "M-;" – the other us used for <code>evil-nerd comment</code>
</p>
<ul class="org-ul">
<li>we cleared "C-;" from Flyspell above</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> goto-last-change
<span style="color: #fe8019;">:ensure</span> t
<span style="color: #fe8019;">:bind</span> <span style="color: #b16286;">(</span><span style="color: #b8bb26;">"C-c g"</span> . goto-last-change<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org6b0adad" class="outline-3">
<h3 id="org6b0adad">Input Buffer, Directory Search</h3>
<div class="outline-text-3" id="text-org6b0adad">
</div>
<div id="outline-container-org709ca92" class="outline-4">
<h4 id="org709ca92">Ivy, Ivy-Rich, and Counsel</h4>
<div class="outline-text-4" id="text-org709ca92">
<p>
Ivy displays vertical completions of input buffer.
</p>
<ul class="org-ul">
<li>When we want the text accepted over the suggest completion use "C-M-j" which executes (ivy-immediate-done) <a href="https://emacs.stackexchange.com/questions/32862/ivy-disable-completion-for-a-command-in-minibuffer">source</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> ivy
<span style="color: #fe8019;">:after</span> counsel
<span style="color: #fe8019;">:defer</span> t
<span style="color: #fe8019;">:config</span>
<span style="color: #b16286;">(</span>ivy-mode 1<span style="color: #b16286;">)</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">remove ^ on the inputbuffer</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> ivy-initial-inputs-alist nil<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc6e6a4a" class="outline-4">
<h4 id="orgc6e6a4a">Ivy-Rich</h4>
<div class="outline-text-4" id="text-orgc6e6a4a">
<p>
Ivy-rich provides information to display in input buffer to counsel.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> ivy-rich
<span style="color: #fe8019;">:after</span> counsel
<span style="color: #fe8019;">:init</span>
<span style="color: #b16286;">(</span>ivy-rich-mode 1<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org4a95612" class="outline-4">
<h4 id="org4a95612">Ivy-prescient</h4>
<div class="outline-text-4" id="text-org4a95612">
<p>
prescient.el provides some helpful behavior for sorting Ivy completion candidates based on how recently or frequently you select them. This can be especially helpful when using M-x to run commands that you don’t have bound to a key but still need to access occasionally.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> ivy-prescient
<span style="color: #fe8019;">:after</span> counsel
<span style="color: #fe8019;">:custom</span>
<span style="color: #b16286;">(</span>ivy-prescient-enable-filtering nil<span style="color: #b16286;">)</span>
<span style="color: #fe8019;">:config</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">Uncomment the following line to have sorting remembered across sessions!</span>
<span style="color: #b16286;">(</span>prescient-persist-mode 1<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>ivy-prescient-mode 1<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orga09359a" class="outline-4">
<h4 id="orga09359a">Counsel</h4>
<div class="outline-text-4" id="text-orga09359a">
<p>
Counsel displays ivy-rich info along with suggestions in input buffer.
</p>
<ul class="org-ul">
<li><code>M-o</code> allows access to help in input buffer.
Archive: elpa, melpa</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> counsel
<span style="color: #fe8019;">:defer</span> t
<span style="color: #fe8019;">:bind</span> <span style="color: #b16286;">(</span><span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"M-x"</span> . counsel-M-x<span style="color: #8ec07c;">)</span> <span style="color: #7c6f64;">; </span><span style="color: #7c6f64;">displays ivy-rich info in minibuffer</span>
<span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"C-x C-f"</span> . counsel-find-file<span style="color: #8ec07c;">)</span>
<span style="color: #fe8019;">:map</span> minibuffer-local-map
<span style="color: #8ec07c;">(</span><span style="color: #b8bb26;">"C-r"</span> . 'counsel-minibuffer-history<span style="color: #8ec07c;">)</span>
<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org38d8581" class="outline-3">
<h3 id="org38d8581">Helpful and Which-key</h3>
<div class="outline-text-3" id="text-org38d8581">
</div>
<div id="outline-container-orgced1be4" class="outline-4">
<h4 id="orgced1be4">Helpful</h4>
<div class="outline-text-4" id="text-orgced1be4">
<p>
Better version of help. We remap normal help keys to Helpful's versions.
Archive: melpa
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> helpful
<span style="color: #fe8019;">:defer</span> 3
<span style="color: #fe8019;">:commands</span> <span style="color: #b16286;">(</span>helpful-callable helpful-variavle helpful-command helpful-key<span style="color: #b16286;">)</span>
<span style="color: #fe8019;">:custom</span>
<span style="color: #b16286;">(</span>counsel-describe-function-function #'helpful-callable<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>counsel-describe-variable-function #'helpful-variable<span style="color: #b16286;">)</span>
<span style="color: #fe8019;">:bind</span>
<span style="color: #b16286;">(</span><span style="color: #8ec07c;">[</span>remap describe-function<span style="color: #8ec07c;">]</span> . counsel-describe-function<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #8ec07c;">[</span>remap describe-command<span style="color: #8ec07c;">]</span> . helpful-command<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #8ec07c;">[</span>remap describe-variable<span style="color: #8ec07c;">]</span> . counsel-describe-variable<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #8ec07c;">[</span>remap describe-key<span style="color: #8ec07c;">]</span> . helpful-key<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org07a87cd" class="outline-4">
<h4 id="org07a87cd">Which-key</h4>
<div class="outline-text-4" id="text-org07a87cd">
<p>
Archive: elpa, melpa
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">use-package</span> which-key
<span style="color: #fe8019;">:defer</span> 1
<span style="color: #fe8019;">:config</span><span style="color: #b16286;">(</span>which-key-mode<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">setq</span> which-key-idle-delay 0.8<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org5d9c6d5" class="outline-3">
<h3 id="org5d9c6d5">Font size</h3>
<div class="outline-text-3" id="text-org5d9c6d5">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-set-font-height</span><span style="color: #b16286;">(</span>value<span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span> <span style="color: #b8bb26;">"nFont height (default is 100): "</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>set-face-attribute 'default nil <span style="color: #fe8019;">:height</span> value<span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span>jmn-set-font-height <span style="color: #b16286;">(</span>alist-get <span style="color: #8ec07c;">(</span>system-name<span style="color: #8ec07c;">)</span> jmn-font-height-alist
100 nil 'string=<span style="color: #b16286;">)</span><span style="color: #458588;">)</span> <span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">default is 100</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">setq</span> text-scale-mode-step 1.05<span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgcf72707" class="outline-3">
<h3 id="orgcf72707">General Helper Function</h3>
<div class="outline-text-3" id="text-orgcf72707">
</div>
<div id="outline-container-orgf20d649" class="outline-4">
<h4 id="orgf20d649">Quickly load init</h4>
<div class="outline-text-4" id="text-orgf20d649">
<p>
Defined earlier in the init so it will load even if there is an error later in the config
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-load-init</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">if</span> <span style="color: #8ec07c;">(</span>version<= <span style="color: #b8bb26;">"27"</span> emacs-version<span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>load <span style="color: #b8bb26;">"~/.emacs.d/init.el"</span><span style="color: #8ec07c;">)</span>
<span style="color: #8ec07c;">(</span>load <span style="color: #b8bb26;">"~/.emacs"</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orge513cd5" class="outline-4">
<h4 id="orge513cd5">jmn-vscode-current-buffer-file-at-point</h4>
<div class="outline-text-4" id="text-orge513cd5">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-vscode-current-buffer-file-at-point</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>start-process-shell-command <span style="color: #b8bb26;">"code"</span>
nil
<span style="color: #8ec07c;">(</span>concat <span style="color: #b8bb26;">"code --goto "</span>
<span style="color: #d65d0e;">(</span>buffer-file-name<span style="color: #d65d0e;">)</span>
<span style="color: #b8bb26;">":"</span>
<span style="color: #d65d0e;">(</span>number-to-string <span style="color: #458588;">(</span>line-number-at-pos<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #b8bb26;">":"</span>
<span style="color: #7c6f64;">;; </span><span style="color: #7c6f64;">+1 who knows why</span>
<span style="color: #d65d0e;">(</span>number-to-string <span style="color: #458588;">(</span>+ 1 <span style="color: #b16286;">(</span>current-column<span style="color: #b16286;">)</span><span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-vscode-current-project-root</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>start-process-shell-command <span style="color: #b8bb26;">"code"</span> nil <span style="color: #8ec07c;">(</span>concat <span style="color: #b8bb26;">"code -r "</span> <span style="color: #d65d0e;">(</span>project-root <span style="color: #458588;">(</span>project-current t<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span><span style="color: #8ec07c;">)</span><span style="color: #b16286;">)</span><span style="color: #458588;">)</span>
<span style="color: #458588;">(</span><span style="color: #fb4933;">defun</span> <span style="color: #fabd2f;">jmn-vscode-current-buffer-in-project-root</span> <span style="color: #b16286;">()</span>
<span style="color: #b16286;">(</span><span style="color: #fb4933;">interactive</span><span style="color: #b16286;">)</span>
<span style="color: #b16286;">(</span>start-process-shell-command <span style="color: #b8bb26;">"code"</span> nil <span style="color: #8ec07c;">(</span>concat <span style="color: #b8bb26;">"code -r "</span> <span style="color: #d65d0e;">(</span>project-root <span style="color: #458588;">(</span>project-current t<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>
<span style="color: #b8bb26;">" --goto "</span>
<span style="color: #d65d0e;">(</span>buffer-file-name<span style="color: #d65d0e;">)</span>
<span style="color: #b8bb26;">":"</span>
<span style="color: #d65d0e;">(</span>number-to-string <span style="color: #458588;">(</span>line-number-at-pos<span style="color: #458588;">)</span><span style="color: #d65d0e;">)</span>