-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
913 lines (875 loc) · 43.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Emacs configuration for C++/CMake/git</title>
<meta name="generator" content="Org mode">
<meta name="author" content="George Kontsevich">
<meta name="description" content="An Emacs configuration for Clojure/C++ development with orgmode"
>
<link rel="stylesheet" type="text/css" href="../web/worg.css" />
<link rel="shortcut icon" href="../web/panda.svg" type="image/x-icon">
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href=".."> UP </a>
|
<a accesskey="H" href=".."> HOME </a>
</div><div id="content">
<h1 class="title">Emacs configuration for C++/CMake/git</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgc13e153">Intro</a></li>
<li><a href="#org2c81497">General Settings</a>
<ul>
<li><a href="#orgd1bc5c9">Hack for AppImage</a></li>
<li><a href="#orga8a33af">Hide menu bars</a></li>
<li><a href="#org72b0d7c">Package managment</a></li>
<li><a href="#orgcc45bc6">Auto-update</a></li>
<li><a href="#orgf30eb51">Import shell variables</a></li>
<li><a href="#orgdb9c6ae">Indentation - Change the default indentation from 2 spaces to 4</a></li>
<li><a href="#org293c6a2">Line wrap</a></li>
<li><a href="#org2b7fc7e">Theme</a></li>
<li><a href="#org2616923">Git</a></li>
<li><a href="#orgca021c6">Autocomplete</a>
<ul>
<li><a href="#org44b40bd">Ivy</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orga8e5911">Standardizing (WIP)</a>
<ul>
<li><a href="#orgb465b02">Overwrite selection</a></li>
<li><a href="#org63a53ec">CUA Mode</a></li>
</ul>
</li>
<li><a href="#org13cd0e8">Orgmode</a>
<ul>
<li><a href="#org211ec31">Some adjustments to org-mode</a></li>
<li><a href="#org077b490">Plotting</a></li>
</ul>
</li>
<li><a href="#orgd475014">C++</a>
<ul>
<li><a href="#org32d6a9b">lsp-mode</a></li>
<li><a href="#org0ebf49f">emacs-cquery</a></li>
</ul>
</li>
<li><a href="#orga4153e8">Clojure</a>
<ul>
<li>
<ul>
<li><a href="#org495e3b8">Company</a></li>
</ul>
</li>
<li><a href="#org6920b7d">Autosave/Backup files</a></li>
<li><a href="#org3c14285">Magit</a></li>
<li><a href="#orgc6de6e8">Projectile</a></li>
<li><a href="#org1a3c98b">images</a></li>
<li><a href="#org745ab36">system-monitor</a></li>
<li><a href="#org9ab411b">which-key</a></li>
<li><a href="#orgb252196">mousewheel</a></li>
<li><a href="#orgb693a7f">eww</a></li>
</ul>
</li>
<li><a href="#orgbf2fae9">Fonts</a></li>
<li><a href="#org64977c7">KeyBindings</a>
<ul>
<li><a href="#org5424f54">F-Key shortcuts</a></li>
</ul>
</li>
<li><a href="#org75c5eab">Bookmarks</a></li>
<li><a href="#org09c17d7">Other notes</a></li>
<li><a href="#orgf2ec11d">Help</a></li>
<li><a href="#org5ad544b">Dired</a></li>
<li><a href="#org4915334">GDB / GUD</a></li>
<li><a href="#org6f3bb66">Compiling</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgc13e153" class="outline-2">
<h2 id="orgc13e153">Intro</h2>
<div class="outline-text-2" id="text-orgc13e153">
<p>
I hope this emacs configuration file will help explain a little elisp and how to write your own.
</p>
<p>
The most important take-away is understanding how emacs can help read and learn from other people's configurations. Once you know how to navigate the documentation you can pick apart any config file and expand your own
</p>
<p>
Note that I wrote this knowing no lisp at all - so if there are mistakes or you would like to make some suggestions I'd really appreciate you telling me by adding an issue on the <a href="https://geokon-gh.github.io/.emacs.d/">github repo</a>
</p>
</div>
</div>
<div id="outline-container-org2c81497" class="outline-2">
<h2 id="org2c81497">General Settings</h2>
<div class="outline-text-2" id="text-org2c81497">
</div>
<div id="outline-container-orgd1bc5c9" class="outline-3">
<h3 id="orgd1bc5c9">Hack for AppImage</h3>
<div class="outline-text-3" id="text-orgd1bc5c9">
<p>
There is <a href="https://github.com/probonopd/Emacs.AppImage/issues/8">some issue</a> with the way the <a href="https://github.com/probonopd/Emacs.AppImage/">Emacs AppImage</a> is setup so it interferes with <code>git</code>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">if</span> (getenv <span style="color: #8b2252;">"APPDIR"</span>) (setenv <span style="color: #8b2252;">"LD_LIBRARY_PATH"</span> nil))
</pre>
</div>
</div>
</div>
<div id="outline-container-orga8a33af" class="outline-3">
<h3 id="orga8a33af">Hide menu bars</h3>
<div class="outline-text-3" id="text-orga8a33af">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
</pre>
</div>
</div>
</div>
<div id="outline-container-org72b0d7c" class="outline-3">
<h3 id="org72b0d7c">Package managment</h3>
<div class="outline-text-3" id="text-org72b0d7c">
<p>
To begin extending Emacs we will want to be able to add external packages. Emacs comes with a built in package manager called <code>package</code> which we will use to get external package. We load it by using <code>require</code> and then we initialize it.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">require</span> '<span style="color: #008b8b;">package</span>)
(package-initialize)
</pre>
</div>
<p>
To see more specifically what the <code>require</code> function does type <code>C-h f require RET</code>. You'll find that virtually every function will have some associted documentation.
</p>
<p>
Note the use of a leading quote before the word <code>package</code>; This tells emacs that the word <code>package</code> is a symbol. If you ommit the quote then emacs will try to evaluate <code>package</code> as a function and give you an error.
</p>
<p>
Next we need to tell the package manager where to look for new packages. There is a limited GNU-blessed repository called <code>ELPA</code>, but we will also want to add another larger repository called <a href="https://melpa.org"><code>MELPA</code></a>. To do that we we just need to add it to the list called <code>package-archives</code><br>
To look up a variable, use <code>C-h v [variable] RET</code>
So type <code>C-h v package-archives RET</code> to see what it's for
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq package-archives '(("gnu" . "http://elpa.emacs-china.org/gnu/")</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">("melpa" . "http://elpa.emacs-china.org/melpa/")))</span>
(add-to-list 'package-archives '(<span style="color: #8b2252;">"melpa"</span> . <span style="color: #8b2252;">"https://melpa.org/packages/"</span>) t)
(package-initialize)
</pre>
</div>
<p>
This <code>C-h [something] [something]</code> pattern repeats for a lot of features. To see the complete list just enter <code>C-h C-h</code>. These key-bindings will be your way of exploring configurations you find online.
</p>
<p>
The newer fancy way of managing package is using <code>use-package</code>. I've included it as a git submodule in my <code>.emacs.d</code> directory which you can see in <a href="https://github.com/geokon-gh/.emacs.d">the repository</a> (be sure to clone recursively if you decide to use my version). You can get it yourself manually from: <a href="https://github.com/jwiegley/use-package">https://github.com/jwiegley/use-package</a>
</p>
<p>
Once we have it in our directory we just need to add it to the <code>load-path</code> and load it in using <code>require</code> like last time
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">setq</span>
load-path
(cons
(concat
(file-name-directory load-file-name)
<span style="color: #8b2252;">"use-package"</span>)
load-path))
(<span style="color: #a020f0;">require</span> '<span style="color: #008b8b;">use-package</span>)
</pre>
</div>
<p>
<code>setq</code> is the function that sets a variable to a value. The <code>q</code> indicates that we don't need to add a quote to the first arguement. There is also the more cumbersome <code>(set 'arg1 'arg2)</code>. The rest of the code is there to append the new path to <code>use-package</code> correctly to the existing <code>load-path</code>.
</p>
</div>
</div>
<div id="outline-container-orgcc45bc6" class="outline-3">
<h3 id="orgcc45bc6">Auto-update</h3>
<div class="outline-text-3" id="text-orgcc45bc6">
<p>
This will make the packages update to the latest version every few days
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package auto-package-update</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:config</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq auto-package-update-delete-old-versions t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">auto-package-update-interval 4)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(auto-package-update-maybe))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgf30eb51" class="outline-3">
<h3 id="orgf30eb51">Import shell variables</h3>
<div class="outline-text-3" id="text-orgf30eb51">
<p>
Especially when we launch emacs in daemon mode, the environmental variables won't be set up. So for example it won't find executables in the PATH b/c the PATH won't be set up the way you have it in your <code>.bashrc</code> file. So there is a special package to fix that
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">exec-path-from-shell</span>
<span style="color: #483d8b;">:ensure</span> t
<span style="color: #483d8b;">:config</span>
(<span style="color: #a020f0;">unless</span> (memq system-type '(ms-dos windos-nt cygwin))
(exec-path-from-shell-initialize)))
</pre>
</div>
</div>
</div>
<div id="outline-container-orgdb9c6ae" class="outline-3">
<h3 id="orgdb9c6ae">Indentation - Change the default indentation from 2 spaces to 4</h3>
<div class="outline-text-3" id="text-orgdb9c6ae">
<p>
Indentation is generally govered by two variables<br>
<code>default-tab-width</code> - this is the variable for any text document when you normally type in a TAB<br>
<code>c-basic-offset</code> - when working with source code the indentation is done automatically and based on this offset value (a lot of modes derive from <code>c-mode</code>, hence the name) <br>
More info: <a href="https://kb.iu.edu/d/abde">https://kb.iu.edu/d/abde</a> <br>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">; </span><span style="color: #b22222;">(setq c-basic-offset 4)</span>
</pre>
</div>
<p>
in ELisp it's also a bit hard to see the indentation level, so I like to add this guide (<b>REMOVED</b>)
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package indent-guide</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:config</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(indent-guide-global-mode))</span>
</pre>
</div>
<p>
Trying out the very weird Parinfer mode (this code is straight copied from <a href="https://github.com/DogLooksGood/parinfer-mode">their github</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package parinfer</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:bind</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(("C-," . parinfer-toggle-mode))</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:init</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(progn</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq parinfer-extensions</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">'(defaults ; should be included.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">pretty-parens ; different paren styles for different modes.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">evil ; If you use Evil.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">lispy ; If you use Lispy. With this extension, you should install Lispy and do not enable lispy-mode directly.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">paredit ; Introduce some paredit commands.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">smart-tab ; C-b & C-f jump positions and smart shift with tab & S-tab.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">smart-yank)) ; Yank behavior depend on mode.</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'clojure-mode-hook #'parinfer-mode)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'emacs-lisp-mode-hook #'parinfer-mode)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'common-lisp-mode-hook #'parinfer-mode)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'scheme-mode-hook #'parinfer-mode)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'lisp-mode-hook #'parinfer-mode)))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org293c6a2" class="outline-3">
<h3 id="org293c6a2">Line wrap</h3>
<div class="outline-text-3" id="text-org293c6a2">
<p>
Next we need to enable line-wrap in org mode. By default, as you keep typing the page scrolls to the right. So a whole paragraph will appear as one line making it difficult to navigate
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-hook 'org-mode-hook (<span style="color: #a020f0;">lambda</span> () (<span style="color: #a020f0;">setq</span> truncate-lines nil)))
</pre>
</div>
<p>
again, don't hesitate to look up all the variables and function. Hooks are in general places where you can add function to be called at designated times. Here it's a function that sets a variable each time org-mode is enabled.
</p>
</div>
</div>
<div id="outline-container-org2b7fc7e" class="outline-3">
<h3 id="org2b7fc7e">Theme</h3>
<div class="outline-text-3" id="text-org2b7fc7e">
<p>
This is the only decent light theme I could find. The advantage over the default theme is that it will color a more things in more modes. The most important to me me is that it will color code blocks in org-mode
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"> <span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package moe-theme</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:config</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(moe-light)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(set-face-attribute 'default nil :background "#ffffff" :foreground "#5f5f5f"))</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package leuven-theme</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:init (setq leuven-scale-outline-headlines nil)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;"> (setq leuven-scale-org-agenda-structure nil)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t)</span>
(custom-theme-set-faces
'user
'(variable-pitch ((t (<span style="color: #483d8b;">:family</span> <span style="color: #8b2252;">"unifont"</span>))))
'(fixed-pitch ((t ( <span style="color: #483d8b;">:family</span> <span style="color: #8b2252;">"unifont"</span>))))
'(org-block ((t (<span style="color: #483d8b;">:inherit</span> fixed-pitch <span style="color: #483d8b;">:background</span> <span style="color: #8b2252;">"#FFFFEA"</span>)))))
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(set-fontset-font t 'han "Zpix")</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'org-mode-hook 'variable-pitch-mode)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'org-mode-hook 'visual-line-mode)</span>
</pre>
</div>
<p>
The last line makes the background white (instead of yellow)
</p>
</div>
</div>
<div id="outline-container-org2616923" class="outline-3">
<h3 id="org2616923">Git</h3>
<div class="outline-text-3" id="text-org2616923">
<p>
For using git we want to have a couple of tools
</p>
</div>
</div>
<div id="outline-container-orgca021c6" class="outline-3">
<h3 id="orgca021c6">Autocomplete</h3>
<div class="outline-text-3" id="text-orgca021c6">
</div>
<div id="outline-container-org44b40bd" class="outline-4">
<h4 id="org44b40bd">Ivy</h4>
<div class="outline-text-4" id="text-org44b40bd">
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">ivy</span>
<span style="color: #483d8b;">:ensure</span> t)
(ivy-mode 1)
(<span style="color: #a020f0;">setq</span> ivy-use-virtual-buffers t)
(<span style="color: #a020f0;">setq</span> ivy-count-format <span style="color: #8b2252;">"(%d/%d) "</span>)
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="outline-container-orga8e5911" class="outline-2">
<h2 id="orga8e5911">Standardizing (WIP)</h2>
<div class="outline-text-2" id="text-orga8e5911">
<p>
These are some changes that bring Emacs more in line with how modern applications work. Most people don't do this.. I'm giving it a try
</p>
</div>
<div id="outline-container-orgb465b02" class="outline-3">
<h3 id="orgb465b02">Overwrite selection</h3>
<div class="outline-text-3" id="text-orgb465b02">
<p>
This will make it so that if you start typing after selecting some text it will actually overwrite what you selected instead of ignoring the selection and appending to the end. See: <a href="https://www.gnu.org/software/emacs/manual/html_node/efaq/Replacing-highlighted-text.html">https://www.gnu.org/software/emacs/manual/html_node/efaq/Replacing-highlighted-text.html</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(delete-selection-mode 1)
</pre>
</div>
</div>
</div>
<div id="outline-container-org63a53ec" class="outline-3">
<h3 id="org63a53ec">CUA Mode</h3>
<div class="outline-text-3" id="text-org63a53ec">
<p>
This is the standard copy-cut-paste shortcuts that are different in Emacs by default. By restoring them to the standard <code>Ctrl C/X/V</code> it will interfere with some existing shortcuts in Emacs. So now whenever you see a <code>Ctrl C</code> You need to hit <code>Ctrl C C</code>. Off the top of my head I know this affects <code>CIDER</code> (Clojure code) and <code>orgmode</code>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">; </span><span style="color: #b22222;">(cua-mode t)</span>
<span style="color: #b22222;">;;</span><span style="color: #b22222;">(use-package ergoemacs-mode</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:config</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq ergoemacs-theme nil)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq ergoemacs-keyboard-layout "us")</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(ergoemacs-mode 1))</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org13cd0e8" class="outline-2">
<h2 id="org13cd0e8">Orgmode</h2>
<div class="outline-text-2" id="text-org13cd0e8">
</div>
<div id="outline-container-org211ec31" class="outline-3">
<h3 id="org211ec31">Some adjustments to org-mode</h3>
<div class="outline-text-3" id="text-org211ec31">
<p>
see <a href="http://howardism.org/Technical/Emacs/literate-programming-tutorial.html">here</a> for reference <br>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">setq</span> org-confirm-babel-evaluate nil <span style="color: #b22222;">;; </span><span style="color: #b22222;">don't prompt for confirmation about executing a block</span>
org-src-tab-acts-natively t
org-use-sub-superscripts '{}
org-src-fontify-natively t
org-clock-into-drawer nil
org-export-backends (<span style="color: #a020f0;">quote</span> (ascii html latex md odt))
org-cycle-emulate-tab 'white
org-export-with-timestamps nil)
(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">htmlize</span>
<span style="color: #483d8b;">:ensure</span> t)
(<span style="color: #a020f0;">setq</span> org-babel-default-header-args:octave '((<span style="color: #483d8b;">:results</span> . <span style="color: #8b2252;">"org"</span>)
(<span style="color: #483d8b;">:session</span> . <span style="color: #8b2252;">"*Inferior Octave*"</span>)
(<span style="color: #483d8b;">:eval</span> . <span style="color: #8b2252;">"never-export"</span>)
(<span style="color: #483d8b;">:exports</span> . <span style="color: #8b2252;">"both"</span>)))
(<span style="color: #a020f0;">setq</span> org-babel-default-header-args:org '((<span style="color: #483d8b;">:eval</span> . <span style="color: #8b2252;">"never"</span>)))
</pre>
</div>
<ul class="org-ul">
<li>Turns off the annoying "are you sure?" prompts on tangle export <br></li>
<li>Makes tabs work in the source code blocks the same as it would in a buffer with that source code <br></li>
<li>Makes it so underscores aren't interpreted as subscripts unless used with braces <br></li>
</ul>
<p>
(I often need underscores for file/variable names) <br>
</p>
<ul class="org-ul">
<li>Make source code gets colored based on the language <br></li>
<li>Newer version of Orgmode stick clocks into logbooks which aren't useful for me <br></li>
<li>Enable exporting to Markdown (for a full set of options run <code>customize-option</code> then enter <code>org-export-backends</code> (editing this will modify your <code>init.el</code>)</li>
<li>Make collapsing and expanding sections with the TAB button work everywhere (except where it makes sense to insert an actual <i>tab</i>)</li>
<li><code>htmlize</code> will colorize orgmode code-blocks code in the exported HTML</li>
<li><code>org-babel-default-header-args</code> are default ways I like to display run results in orgmode (subject to change)</li>
</ul>
<p>
For more info on any of these variables, again, use <code>C-h v [variable] RET</code>
</p>
</div>
</div>
<div id="outline-container-org077b490" class="outline-3">
<h3 id="org077b490">Plotting</h3>
<div class="outline-text-3" id="text-org077b490">
<p>
For one of my ongoing "project" I want my ELisp code to be able to output plots. For that we need to add <code>gnuplot</code> and then <a href="https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html#org66dbe2c">enable execution</a> of <code>gnuplot</code> blocks in <code>orgmode</code>. The last line lets me make plots interactively in the <code>gnuplot</code> buffer
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">gnuplot</span>
<span style="color: #483d8b;">:ensure</span> t)
(org-babel-do-load-languages
'org-babel-load-languages
'((gnuplot . t)
(octave . t)
(clojure . t)))
(gnuplot-inline-display-mode)
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgd475014" class="outline-2">
<h2 id="orgd475014">C++</h2>
<div class="outline-text-2" id="text-orgd475014">
<p>
Here we'll setup a development environment as feature rich as an IDE <br>
We're going to use the new language server protocol way (instead of rtags as before). I'm just following <a href="https://github.com/cquery-project/cquery/wiki/Emacs">the official guide</a>
</p>
</div>
<div id="outline-container-org32d6a9b" class="outline-3">
<h3 id="org32d6a9b">lsp-mode</h3>
<div class="outline-text-3" id="text-org32d6a9b">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package lsp-mode</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org0ebf49f" class="outline-3">
<h3 id="org0ebf49f">emacs-cquery</h3>
<div class="outline-text-3" id="text-org0ebf49f">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package emacs-cquery</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:commands lsp-cquery-enable</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:init (setq cquery-executable "~/Programs/cquery/bin/cquery")</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'c-mode-hook #'cquery//enable)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-hook 'c++-mode-hook #'cquery//enable)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orga4153e8" class="outline-2">
<h2 id="orga4153e8">Clojure</h2>
<div class="outline-text-2" id="text-orga4153e8">
<p>
(WIP)
Getting Clojure to play friendly with Orgmode is a bit weird. But you can sorta get it to work like ELisp, where you execute blocks within the document itself useing <code>C-c C-c</code>. You just need to open the corresponding tangled <code>.clj</code> file once, launch the REPL using <code>C-c M-J</code> and then make sure it's all loaded with <code>C-c C-k</code>. After this you don't need to really touch the tangled file anymore. You just need to change to the correct namespace in your REPL with the usual <code>(in-ns 'something.somethingelse)</code> and then you can just stick to running code blocks in the org document. The last step is crucial b/c when you run blocks in your org document they will be effectively running in whatever state your REPL is in (though the output will go to RESULTS blocks in the org document and not the REPL output/buffer). So it's a bit goofy.. b/c the org document runs are tied to the current REPL state.
</p>
<p>
If there is no REPL running then the thing seems to just not run at all. The <code>auto-jack-in</code> option here doesn't seem to really work unfortunately. This might make exporting with no running REPL a bit broken. We'll see how the setup works..
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">require</span> '<span style="color: #008b8b;">ob-clojure</span>)
(<span style="color: #a020f0;">setq</span> org-babel-clojure-backend 'cider)
(<span style="color: #a020f0;">setq</span> ob-clojure-literate-auto-jackin-p t)
</pre>
</div>
<p>
Starting to play around with <code>Clojure</code>. The canonical <code>Clojure</code> development environment is <code>CIDER</code>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">cider</span>
<span style="color: #483d8b;">:ensure</span> t
<span style="color: #483d8b;">:init</span> (<span style="color: #a020f0;">setq</span> org-babel-clojure-backend 'cider))
</pre>
</div>
<p>
Add a default CIDER alias
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">setq</span> cider-clojure-cli-global-options <span style="color: #8b2252;">"-A:server:client:dev"</span>)
</pre>
</div>
</div>
<div id="outline-container-org495e3b8" class="outline-4">
<h4 id="org495e3b8">Company</h4>
<div class="outline-text-4" id="text-org495e3b8">
<p>
Next we turn on <code>company</code>. The package that will do autocompletion for us (it standards for COMPlete ANYthing)
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">company</span>
<span style="color: #483d8b;">:config</span>
(add-hook 'cider-repl-mode-hook #'cider-company-enable-fuzzy-completion)
(add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion)
(global-set-key (kbd <span style="color: #8b2252;">"TAB"</span>) #'company-indent-or-complete-common))
<span style="color: #b22222;">;</span><span style="color: #b22222;">(push 'company-rtags company-backends) TODO: FIX this RTags related stuff!</span>
<span style="color: #b22222;">;;</span><span style="color: #b22222;">(global-company-mode)</span>
</pre>
</div>
<p>
looking at the documentation we see that <code>push</code> will take the 1st argument and add it to the beginning of the list provided in the 2nd argument. <code>company-backends</code> is "a list of active backends (completion engines)". <code>company-rtags</code> is a backend provided by the <code>rtags</code> guys. See the documentation for more info :)
</p>
</div>
</div>
<div id="outline-container-org6920b7d" class="outline-3">
<h3 id="org6920b7d">Autosave/Backup files</h3>
<div class="outline-text-3" id="text-org6920b7d">
<p>
By default Emacs will save copies of files with a <code>~</code> appended. This ends up cluttering directories and makes any directory touched by Emacs a bit of a mess. Instead we can have Emacs save files to a central directory.
</p>
<p>
See: <a href="https://www.emacswiki.org/emacs/BackupDirectory">https://www.emacswiki.org/emacs/BackupDirectory</a> and <a href="https://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files">https://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">setq</span>
backup-by-copying t <span style="color: #b22222;">; </span><span style="color: #b22222;">don't clobber symlinks</span>
backup-directory-alist
'((<span style="color: #8b2252;">"."</span> . <span style="color: #8b2252;">"~/.saves/"</span>)) <span style="color: #b22222;">; </span><span style="color: #b22222;">don't litter my fs tree</span>
delete-old-versions t
kept-new-versions 6
kept-old-versions 2)
</pre>
</div>
</div>
</div>
<div id="outline-container-org3c14285" class="outline-3">
<h3 id="org3c14285">Magit</h3>
<div class="outline-text-3" id="text-org3c14285">
<p>
This is the tool for inspecting and updating out git repository. It's a little complicated to use, so look up documentation for it. It is a must for development in emacs if you use <code>git</code> - so make the investment and learn to use it.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">magit</span>
<span style="color: #483d8b;">:ensure</span> t
<span style="color: #483d8b;">:init</span>)
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(setq magit-display-buffer-function #'magit-display-buffer-fullcolumn-most-v1))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc6de6e8" class="outline-3">
<h3 id="orgc6de6e8">Projectile</h3>
<div class="outline-text-3" id="text-orgc6de6e8">
<p>
This will manage our workspaces. Each workspace will be tied to a git repository. This makes it so that our buffer list doesn't get really crowded when we are working on multiple projects
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">projectile</span>
<span style="color: #483d8b;">:ensure</span> t
<span style="color: #483d8b;">:config</span>
(projectile-mode +1))
(define-key projectile-mode-map (kbd <span style="color: #8b2252;">"s-p"</span>) 'projectile-command-map)
(define-key projectile-mode-map (kbd <span style="color: #8b2252;">"C-c p"</span>) 'projectile-command-map)
(<span style="color: #a020f0;">setq</span> projectile-completion-system 'ivy)
(<span style="color: #a020f0;">setq</span> projectile-use-git-grep t)
(<span style="color: #a020f0;">setq</span> projectile-use-native-indexing t)
<span style="color: #b22222;">;;</span><span style="color: #b22222;">(setq projectile-enable-caching t)</span>
(<span style="color: #a020f0;">setq</span> projectile-git-command <span style="color: #8b2252;">"/usr/bin/git ls-files -zc"</span>)
</pre>
</div>
<p>
I sometimes use this - and other times I just run separate emacs sessions for different projects.
</p>
</div>
</div>
<div id="outline-container-org1a3c98b" class="outline-3">
<h3 id="org1a3c98b">images</h3>
<div class="outline-text-3" id="text-org1a3c98b">
<p>
When you open a GIF, make it loop forever (instead of playing through once and stopping
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">setq</span> image-animate-loop t)
</pre>
</div>
<p>
Hit <code>RET</code> to have it start playing
</p>
</div>
</div>
<div id="outline-container-org745ab36" class="outline-3">
<h3 id="org745ab36">system-monitor</h3>
<div class="outline-text-3" id="text-org745ab36">
<p>
A tiny in-bar system monitor is convenient (and doesn't need to be part of my desktop).
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(use-package symon</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:ensure t</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">:config</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(add-to-list 'symon-monitors 'symon-linux-battery-monitor)</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(symon-mode))</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9ab411b" class="outline-3">
<h3 id="org9ab411b">which-key</h3>
<div class="outline-text-3" id="text-org9ab411b">
<p>
This is gunna give us tips for different modes so we can learn new key-combos
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">use-package</span> <span style="color: #008b8b;">which-key</span>
<span style="color: #483d8b;">:ensure</span> t)
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb252196" class="outline-3">
<h3 id="orgb252196">mousewheel</h3>
<div class="outline-text-3" id="text-orgb252196">
<p>
make scrolling in Emacs more sane
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;</span><span style="color: #b22222;">(setq mouse-wheel-scroll-amount '(0.07))</span>
(<span style="color: #a020f0;">setq</span> mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(<span style="color: #a020f0;">setq</span> mouse-wheel-progressive-speed nil)
(<span style="color: #a020f0;">setq</span> scroll-step 1)
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb693a7f" class="outline-3">
<h3 id="orgb693a7f">eww</h3>
<div class="outline-text-3" id="text-orgb693a7f">
<p>
Set links to open in the Emacs browser (then press & if you need to open them in Firefox)
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;</span><span style="color: #b22222;">(setq browse-url-browser-function 'eww-browse-url)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgbf2fae9" class="outline-2">
<h2 id="orgbf2fae9">Fonts</h2>
<div class="outline-text-2" id="text-orgbf2fae9">
<p>
Example of how to set a font from within Emacs
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span style="color: #b22222;">;; </span><span style="color: #b22222;">(set-face-attribute 'default nil :font "tewi:pixelsize=11:foundry=lucy:weight=normal:slant=normal:width=normal:spacing=110:scalable=false")</span>
<span style="color: #b22222;">;; </span><span style="color: #b22222;">(set-frame-font "tewi:pixelsize=11:foundry=lucy:weight=normal:slant=normal:width=normal:spacing=110:scalable=false" nil t)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org64977c7" class="outline-2">
<h2 id="org64977c7">KeyBindings</h2>
<div class="outline-text-2" id="text-org64977c7">
</div>
<div id="outline-container-org5424f54" class="outline-3">
<h3 id="org5424f54">F-Key shortcuts</h3>
<div class="outline-text-3" id="text-org5424f54">
<ul class="org-ul">
<li>magit status</li>
<li>git gutter</li>
<li>export to html</li>
<li>tangle file</li>
<li>refresh/revert file</li>
<li>launch REPL</li>
<li id="F12">Go to Definition (VS)</li>
<li id="F11">Step Into</li>
<li id="F12">Step Out</li>
<li id="F10">Step Over</li>
<li id="F9">Toggle Breakpoint (VS)</li>
<li id="F8">Build Selection</li>
<li id="F7"></li>
<li id="F5">Debug Start</li>
<li id="F3">Split Window (Dolphin)</li>
<li id="F4">Shell (Dolphin)</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(global-set-key (kbd <span style="color: #8b2252;">"<f2>"</span>) 'magit-status)
(global-set-key (kbd <span style="color: #8b2252;">"<f3>"</span>) 'cider-browse-ns)
(global-set-key (kbd <span style="color: #8b2252;">"<f4>"</span>) 'eshell)
(<span style="color: #a020f0;">setq</span> display-buffer-alist '((<span style="color: #8b2252;">"\\`\\*e?shell"</span> display-buffer-use-some-window)))
(global-set-key (kbd <span style="color: #8b2252;">"<f5>"</span>) 'calendar)
(global-set-key (kbd <span style="color: #8b2252;">"<f6>"</span>) 'org-babel-tangle)
(global-set-key (kbd <span style="color: #8b2252;">"<f7>"</span>) 'org-html-export-to-html)
(global-set-key (kbd <span style="color: #8b2252;">"<f8>"</span>) 'eshell)
(global-set-key (kbd <span style="color: #8b2252;">"<f9>"</span>) 'cider-jack-in)
(global-set-key (kbd <span style="color: #8b2252;">"<f10>"</span>) 'cider-xref-fn-refs)
(global-set-key (kbd <span style="color: #8b2252;">"<f11>"</span>) 'cider-browse-ns-all)
(global-set-key (kbd <span style="color: #8b2252;">"<f12>"</span>) ''cider-enlighten-mode)
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org75c5eab" class="outline-2">
<h2 id="org75c5eab">Bookmarks</h2>
<div class="outline-text-2" id="text-org75c5eab">
<p>
Live in <code>~/.emacs.d/bookmarks</code> <br>
Set bookmarks with =
</p>
<ul class="org-ul">
<li><code>C-x r m RET</code></li>
<li><code>C-x r m /bookmark/ RET</code></li>
</ul>
<p>
Jump to bookmark
</p>
<ul class="org-ul">
<li><code>C-x r b /bookmark/ RET</code></li>
</ul>
<p>
List bookmarks
</p>
<ul class="org-ul">
<li><code>C-x r l</code></li>
</ul>
</div>
</div>
<div id="outline-container-org09c17d7" class="outline-2">
<h2 id="org09c17d7">Other notes</h2>
<div class="outline-text-2" id="text-org09c17d7">
<ul class="org-ul">
<li><code>C-l</code> recenter around point</li>
<li><code>show-trailing-whitespace</code> - to display.. whitespace</li>
<li><code>delete-trailing-whitespace</code></li>
<li><code>display-time</code></li>
<li><code>display-battery-mode</code></li>
</ul>
<p>
"Save As"
</p>
<ul class="org-ul">
<li><code>C-x C-w</code></li>
</ul>
<p>
Autoreload files (like logs.. ones that change "under you")
</p>
</div>
</div>
<div id="outline-container-orgf2ec11d" class="outline-2">
<h2 id="orgf2ec11d">Help</h2>
<div class="outline-text-2" id="text-orgf2ec11d">
<ul class="org-ul">
<li><code>C-h C-h</code> general help menu</li>
<li><code>C-h a /topic/ RET</code> appropos</li>
<li><code>C-h i d m emacs RET i /topic/ RET</code> index</li>
<li><code>C-h i d m emacs RET s /topic/ RET</code> manual text</li>
<li><code>C-h C-f</code> FAQ</li>
<li><code>[prefix] C-h</code> completion options</li>
<li><code>C-h b</code> all active bindings (minor/major modes)</li>
<li><code>C-h m</code> major/minor modes</li>
<li><code>C-h d /topic/ RET</code> apropos</li>
<li><code>C-h e</code> <b>Messages</b> buffer</li>
<li><code>C-h h</code> HELLO file + character set</li>
<li><code>C-h i</code> Info + Manual</li>
<li><code>C-h k /key/</code> describe key</li>
<li><code>C-h o /symbol/</code> info on symbol</li>
</ul>
</div>
</div>
<div id="outline-container-org5ad544b" class="outline-2">
<h2 id="org5ad544b">Dired</h2>
<div class="outline-text-2" id="text-org5ad544b">
<ul class="org-ul">
<li><code>C-x C-d</code> directory listing</li>
<li><code>C-u C-x C-d</code> vebose directory listing</li>
<li><code>make-directory</code></li>
<li><code>delete-directory</code></li>
<li><code>q</code> bury Dired buffer</li>
<li><code>SPC/n</code> navigate dired up/down</li>
<li><code>j</code> go to file</li>
<li><code>e/f RET</code> extract file into buffer <b>tar mode</b></li>
<li><code>d</code> delete</li>
<li><code>m</code> mark as file (with a *)</li>
<li><code>**</code> mark all executable files</li>
<li><code>u</code> unmark</li>
<li><code>x</code> execute pending operations</li>
<li><code>C /new/ RET</code> like <b>cp</b> with <i>new</i> being the arg</li>
<li><code>D</code> like <b>rm</b> removed marked files</li>
<li><code>R /new RET</code> rename</li>
<li><code>H /new RET</code> hard link</li>
<li><code>S /new RET</code> soft link</li>
<li><code>M /new RET</code> change mode</li>
<li><code>G /new RET</code> new group</li>
<li><code>O /new RET</code> new owner</li>
<li><code>T /new RET</code> touch</li>
<li><code>Z</code> compress (each into it's own archive)</li>
<li><code>c</code> compress into one archive</li>
<li><code>:d</code> decompress</li>
<li><code>:v</code> verify signature</li>
<li><code>:s</code> sign</li>
<li><code>:e</code> encrypt</li>
<li><code>!</code> run shell command</li>
<li><code>&</code> same but async</li>
<li><code>I</code> insert file (empty)</li>
<li><code>)</code> Hide details (we turn on by default)</li>
<li><code>~</code> go "up" a directory (like <code>..</code>)</li>
<li><code>/host:filename</code></li>
<li><code>/user@host:filename</code></li>
<li><code>/user@host#port:filename</code></li>
<li><code>method:user@host#port:filename</code></li>
</ul>
</div>
</div>
<div id="outline-container-org4915334" class="outline-2">
<h2 id="org4915334">GDB / GUD</h2>
<div class="outline-text-2" id="text-org4915334">
<ul class="org-ul">
<li><code>M-x gdb</code> runs the GDB graphical interface</li>
<li><code>M-x gud-gdb</code> run GUD and GDB as a subprocess</li>
<li><code>C-x C-a C-b</code> set breakpoint at current source line</li>
<li><code>C-c C-l</code> display the last source line in another window</li>
<li><code>C-c C-s</code> run next line ENTER function</li>
<li><code>C-c C-n</code> STEPOVER</li>
<li><code>C-c C-i</code> execute a simple machine instruction</li>
<li><code>C-c C-p</code> evaluate expression at point - can mark a region</li>
<li><code>C-c C-r</code> CONTINUE</li>
<li><code>C-c C-d</code> delete breakpoint</li>
<li><code>C-c C-t</code> temp breakpoint</li>
<li><code>C-c >/<</code> up/down stack</li>
<li><code>C-c C-u</code> CONTINUE to current line</li>
<li><code>C-c C-f</code> run till stack frame is done</li>
<li><code>C-x C-a C-j</code> jump to point</li>
<li><code>C-x k</code> kill the GUD session and all associated buffers</li>
</ul>
</div>
</div>
<div id="outline-container-org6f3bb66" class="outline-2">
<h2 id="org6f3bb66">Compiling</h2>
<div class="outline-text-2" id="text-org6f3bb66">
<ul class="org-ul">
<li><code>compile</code> runs the compile command (default <code>make -k</code>) in the current buffer's directory</li>
<li><code>recompile</code> reruns compile in the previous directory</li>
<li><code>C-x `</code> go to next error message</li>
<li><code>M-;</code> go to next error</li>
</ul>
</div>
</div>
</div>
</body>
</html>