forked from niyumard/Doom-Emacs-Cheat-Sheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
833 lines (822 loc) · 35.8 KB
/
README.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
<?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>
<!-- 2021-11-17 Wed 00:14 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>The Ultimate Doom Emacs Cheatsheet</title>
<meta name="author" content="Hossein Naghdbishi" />
<meta name="generator" content="Org Mode" />
<style>
#content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #e6e6e6;
border-radius: 3px;
background-color: #f2f2f2;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
}
pre.src:before {
display: none;
position: absolute;
top: -8px;
right: 12px;
padding: 3px;
color: #555;
background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
</style>
<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"/>
<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/readtheorg.js"></script>
</head>
<body>
<div id="content" class="content">
<h1 class="title">The Ultimate Doom Emacs Cheatsheet</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="#org7590b20">1. A few tips for Emacs newbies</a></li>
<li><a href="#orgc66952c">2. Command Abbreviations</a></li>
<li><a href="#orgbd3b08d">3. General</a></li>
<li><a href="#orga06ffba">4. Projects with Projectile</a></li>
<li><a href="#org7ea6b6f">5. Dired</a></li>
<li><a href="#org5424a93">6. Buffers, Windows and Basic Navigation</a>
<ul>
<li><a href="#org7465159">6.1. Buffers</a></li>
<li><a href="#org40aac09">6.2. Windows</a></li>
<li><a href="#orge5e8a5c">6.3. Workspaces</a></li>
</ul>
</li>
<li><a href="#orgdd329c8">7. Installing Packages using org-super-agenda as an example</a></li>
<li><a href="#orga100aff">8. Quick, horizontal movements with evil-snipe</a>
<ul>
<li><a href="#orgf374984">8.1. Inine navigation</a></li>
<li><a href="#org2847e74">8.2. Long distance navigation inside the file</a></li>
</ul>
</li>
<li><a href="#org4700314">9. Multiple cursor in Emacs with Evil-multiedit</a></li>
<li><a href="#org3742fdd">10. Org Mode</a>
<ul>
<li><a href="#org93e23e9">10.1. Basics</a></li>
<li><a href="#orgd86db83">10.2. Links, Hyperlinks and more</a></li>
<li><a href="#orgf2eac2b">10.3. Defining custoom Link Types</a></li>
<li><a href="#org994f865">10.4. Linking to words & Bookmarks</a></li>
<li><a href="#org5149c05">10.5. Code Snippets & Babel</a></li>
<li><a href="#org0527eeb">10.6. Task Management</a>
<ul>
<li><a href="#orgd401f1b">10.6.1. Priorities for Tasks</a></li>
<li><a href="#orgc9e3975">10.6.2. Marking Tasks with Tags</a></li>
<li><a href="#org8616956">10.6.3. Setting a poperty for a task/headline</a></li>
</ul>
</li>
<li><a href="#org4422b97">10.7. Lists</a></li>
<li><a href="#org07f3b12">10.8. Checkboxes</a>
<ul>
<li><a href="#org65378d5">10.8.1. You can see how many are done with a “cookie” <code>[1/2]</code></a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orga4062cb">11. Magit</a>
<ul>
<li><a href="#org6233002">11.1. Git Commit Flow in More Detail</a></li>
<li><a href="#org7f8a9d2">11.2. Magit with Forge for Issuing Pull Requests - Emacs</a></li>
</ul>
</li>
<li><a href="#org8760360">12. Terminal</a></li>
<li><a href="#org1e70de6">13. File Tree</a></li>
<li><a href="#org3fae2c4">14. Others</a></li>
<li><a href="#orgf7f34e7">15. Capturing</a></li>
<li><a href="#org6b8c4b9">16. Org Roam</a></li>
<li><a href="#org1e52724">17. Sources</a></li>
<li><a href="#orga354843">18. What to learn <code>[0/4]</code></a></li>
</ul>
</div>
</div>
<div id="outline-container-org7590b20" class="outline-2">
<h2 id="org7590b20"><span class="section-number-2">1.</span> A few tips for Emacs newbies</h2>
<div class="outline-text-2" id="text-1">
<ul class="org-ul">
<li>If you learn to use <a href="https://www.emacswiki.org/emacs/EmacsClient">emacsclient</a> and set up a daemon your Emacs experience will improve <b>a lot</b> and you’ll live a longer life.</li>
<li>Learn to use Emacs’s inner file manager.</li>
<li>Try to avoid terminal version of emacs when possible.</li>
<li>Github doesn’t render org files very well. It’s best that you <a href="https://raw.githubusercontent.com/niyumard/Doom-Emacs-Cheat-Sheet/main/README.org">download this file</a> and open it in Emacs. If not possible, use the <a href="https://naghdbishi.ir/Doom-Emacs-Cheat-Sheet/README.html">html version</a> made with <a href="https://github.com/fniessen/org-html-themes">org-html-themes</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgc66952c" class="outline-2">
<h2 id="orgc66952c"><span class="section-number-2">2.</span> Command Abbreviations</h2>
<div class="outline-text-2" id="text-2">
<ul class="org-ul">
<li><code>C</code> - “Control” key</li>
<li><code>M</code> - “M” or “option/alt” key</li>
<li><code>s</code> - “Command” key</li>
<li><code>SPC</code> - “Space” key</li>
</ul>
</div>
</div>
<div id="outline-container-orgbd3b08d" class="outline-2">
<h2 id="orgbd3b08d"><span class="section-number-2">3.</span> General</h2>
<div class="outline-text-2" id="text-3">
<ul class="org-ul">
<li><code>SPC f s</code> for saving the current file</li>
<li><code>SPC :</code> for entering a command</li>
<li><code>SPC q q</code> to close Emacs</li>
<li><code>SPC f D</code> to delete this file</li>
</ul>
</div>
</div>
<div id="outline-container-orga06ffba" class="outline-2">
<h2 id="orga06ffba"><span class="section-number-2">4.</span> Projects with Projectile</h2>
<div class="outline-text-2" id="text-4">
<ul class="org-ul">
<li><code>SPC p p</code> to open a project</li>
<li><code>SPC SPC</code> to open a file in a project</li>
<li><code>SPC o p</code> to open the file explorer</li>
<li><code>SPC o E</code> to open the shell (eshell) in fullscreen</li>
<li><code>SPC o e</code> to open the shell (eshell) in a popup window</li>
<li><code>SPC f r</code> recently visited files</li>
<li><code>SPC f R</code> recently visited files in a project</li>
<li><code>M-x projectile-discover-projects-in-directory</code> to find projects
within given folder using Projectile</li>
<li><code>M-x projectile-discover-projects-in-search-path</code> to find projects in
the folder defined by the <code>projectile-project-search-path</code> variable
using Projectile</li>
</ul>
</div>
</div>
<div id="outline-container-org7ea6b6f" class="outline-2">
<h2 id="org7ea6b6f"><span class="section-number-2">5.</span> Dired</h2>
<div class="outline-text-2" id="text-5">
<ul class="org-ul">
<li>Dired (Directory Editor) is how you interfaces with a directory</li>
<li>Press <code>C-x d</code> to open dired.
<li>Use <code>RET</code> to go to a folder or open a file.</li>
<li>Use <code>-</code> for going one folder back</li>
<li>Use <code>+</code> for creating a new directory</li>
<li>Use <code>d</code> to mark the files for deletion, press <code>x</code> to delete.</li>
<li>Use <code>M</code> to change permissions</li>
<li>Use <code>o</code> to sort by modes.</li>
<li>Use <code>O</code> to change the owner.</li>
<li>Use <code>m</code> to mark and <code>u</code> to unmark files or directories.</li>
<li><code>U</code> to unselect all</li>
<li>Use <code>t</code> to invert the selection.</li>
<li><code>t</code> to switch between files and directories</li>
<li>Use <code>C</code> to copy.</li>
<li>Use <code>R</code> to move.</li>
<li>Move with <code>h</code>, <code>j</code>, <code>k</code>, <code>l</code></li>
<li>Toggle <code>(</code> for simple view</li>
<li><code>SPC .</code> to create or find a file</li>
<li><code>*</code> to select all directories.</li>
<li><code>C</code> copy to another window</li>
<li><code>R</code> move to another window</li>
<li><code>dired-do-what-i-mean-target</code> set to true</li>
<li><code>i</code> to edit file/dir name</li>
</ul>
</div>
</div>
<div id="outline-container-org5424a93" class="outline-2">
<h2 id="org5424a93"><span class="section-number-2">6.</span> Buffers, Windows and Basic Navigation</h2>
<div class="outline-text-2" id="text-6">
</div>
<div id="outline-container-org7465159" class="outline-3">
<h3 id="org7465159"><span class="section-number-3">6.1.</span> Buffers</h3>
<div class="outline-text-3" id="text-6-1">
<ul class="org-ul">
<li>Buffers are a special concept in emacs they can be terminals, files,
directories, etc</li>
<li><code>SPC b b</code> to open another buffer
<ul class="org-ul">
<li>workspace buffer</li>
</ul></li>
<li><code>SPC b B</code> you can see all the buffer</li>
<li><code>SPC ,</code> to switch buffers (its an alias)</li>
<li><code>SPC SHIFT ,</code> to switch to all buffers</li>
<li><code>SPC b X</code> You can create a scratch buffer</li>
<li><code>SPC b s</code> to save and name it</li>
</ul>
</div>
</div>
<div id="outline-container-org40aac09" class="outline-3">
<h3 id="org40aac09"><span class="section-number-3">6.2.</span> Windows</h3>
<div class="outline-text-3" id="text-6-2">
<ul class="org-ul">
<li><code>CTRL w v</code> window split vertically</li>
<li><code>CTRL w s</code> window split horizonal</li>
<li><code>CTRL w w</code> to switch windows</li>
<li><code>SPC w q</code> to kill windows</li>
<li><code>SPC w +</code> and <code>SPC w -</code> to increase and decrease window height</li>
<li><code>SPC w ></code> and <code>SPC w <</code> to increase and decrease window width</li>
<li>You can use vim motion keys to navigate between open windows for example <code>SPC w H</code> moves the window to the left.</li>
<li>Windows are panes in your screen</li>
</ul>
</div>
</div>
<div id="outline-container-orge5e8a5c" class="outline-3">
<h3 id="orge5e8a5c"><span class="section-number-3">6.3.</span> Workspaces</h3>
<div class="outline-text-3" id="text-6-3">
<ul class="org-ul">
<li><code>SPC TAB n</code> New workspace</li>
<li><code>SPC TAB N</code> Newly named workspace</li>
<li><code>SPC TAB [</code> Previous workspace</li>
<li><code>SPC TAB ]</code> Next workspace</li>
<li><code>SPC TAB d</code> Remove workspace</li>
<li><code>SPC TAB R</code> Restore last session</li>
<li><code>M-1</code> Switch to workspace 1</li>
<li><code>M-2</code> Switch to workspace 2 and so forth.</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-orgdd329c8" class="outline-2">
<h2 id="orgdd329c8"><span class="section-number-2">7.</span> Installing Packages using org-super-agenda as an example</h2>
<div class="outline-text-2" id="text-7">
<ul class="org-ul">
<li><code>SPC f p</code> to open the config.</li>
<li>To add a package, add the package to <code>.doom.d/package.el</code></li>
<li>Then close and <code>doom refresh</code></li>
<li>Then go to <code>.doom.d/config.el</code> to configure the package</li>
<li><code>def-package!</code> is a macro you can use to configure packages
<ul class="org-ul">
<li><code>space h help</code> you can look up method man pages</li>
<li><code>:init</code> is used for setting the package up</li>
<li><code>:config</code> to set configuration after the package has been
initialized</li>
<li><code>:after</code> lets you set which package it should load after</li>
</ul></li>
<li>You can use <code>:after!</code> to configure packages that are already there</li>
</ul>
</div>
</div>
<div id="outline-container-orga100aff" class="outline-2">
<h2 id="orga100aff"><span class="section-number-2">8.</span> Quick, horizontal movements with evil-snipe</h2>
<div class="outline-text-2" id="text-8">
</div>
<div id="outline-container-orgf374984" class="outline-3">
<h3 id="orgf374984"><span class="section-number-3">8.1.</span> Inine navigation</h3>
<div class="outline-text-3" id="text-8-1">
<ul class="org-ul">
<li><code>f</code> and then the letter you want to navigate to.
<ul class="org-ul">
<li><code>,</code> will go backward</li>
<li><code>;</code> will go forward after that “find”</li>
</ul></li>
<li><code>t</code> to find and move cursor to the charachter before what you’ve searched.</li>
<li><code>v</code> puts you in visual mode. You can select text by with <code>v t some-char-you-navigate-to</code> or <code>v f some-char-you-navigate-to</code></li>
<li><code>;</code> to jump to the next find</li>
<li><code>,</code> to jump to the previous one</li>
<li><code>s</code> to snipe</li>
</ul>
</div>
</div>
<div id="outline-container-org2847e74" class="outline-3">
<h3 id="org2847e74"><span class="section-number-3">8.2.</span> Long distance navigation inside the file</h3>
<div class="outline-text-3" id="text-8-2">
<ul class="org-ul">
<li>Evil-snipe lets you go to all the occuranses in your document</li>
<li><code>g s SPC</code> to use avy and going to a certain word in file.</li>
<li><code>t</code> is the same thing except for a character you want to jump to before the one you insert</li>
<li><code>s</code> to do a double character search</li>
<li>Evil-snipe will remember your last search so <code>,</code> and <code>;</code> will navigate</li>
<li><code>F</code> or <code>T</code> to go backwards</li>
<li><code>g s SPC</code> and then select the letter that avy gives you to navigate to that spot
<ul class="org-ul">
<li>These letters are on your home row so they are easy to click</li>
</ul></li>
<li><code>SPC h v</code> for variable, to set the avy variable to search all open
windows
<ul class="org-ul">
<li><code>avy-all-windows</code> lets you search in all windows open.</li>
</ul></li>
<li>You can remove a word with
<code>g s SPC select-one-letter x select-the-removal-spot</code>
<ul class="org-ul">
<li>You can use <code>X</code> to stay in your original spot of search</li>
</ul></li>
<li>You can go <code>g s space select-one-letter i select-the-correction-spot</code>
to correct the spelling of the search
<ul class="org-ul">
<li>Install ispell on your OS first</li>
</ul></li>
<li>You can <code>yank</code> a word from one place to another with
<code>g s SPC select-one-letter y select-the-correction-spot-to-paste</code></li>
<li>Use <code>t</code> to “teleport” the word from one place to another
<code>g s SPC select-one-letter t select-the-correction-spot-to-teleport</code></li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org4700314" class="outline-2">
<h2 id="org4700314"><span class="section-number-2">9.</span> Multiple cursor in Emacs with Evil-multiedit</h2>
<div class="outline-text-2" id="text-9">
<ul class="org-ul">
<li>Make selections and then edit those selections interactively</li>
<li><code>M d</code> will select the current word, and again will find another
occurance</li>
<li><code>M D</code> will find the occurence upward</li>
<li>You can use a visual selection to select multiple words.</li>
<li><code>R</code> will select all occurances</li>
<li><code>CTRL n</code> for next selection <code>CTRL p</code> for previous</li>
<li>Exclude matches with <code>RET</code></li>
<li>You can make an edit and the changes will be reflected in all the
selection</li>
</ul>
</div>
</div>
<div id="outline-container-org3742fdd" class="outline-2">
<h2 id="org3742fdd"><span class="section-number-2">10.</span> Org Mode</h2>
<div class="outline-text-2" id="text-10">
</div>
<div id="outline-container-org93e23e9" class="outline-3">
<h3 id="org93e23e9"><span class="section-number-3">10.1.</span> Basics</h3>
<div class="outline-text-3" id="text-10-1">
<ul class="org-ul">
<li>Org mode gives you structure to your document</li>
<li><code>*</code> for a h1 <code>**</code> for an h2 and so on</li>
<li>You can <code>TAB</code> a section to fold a subtree (hide it)</li>
<li>You can use <code>SHIFT TAB</code> to cycle through folded states</li>
<li><code>CTRL return</code> to create a headline of the same type</li>
<li><code>M arrow up</code> lets you shift the position of the section</li>
<li><code>M h</code> promotes a headline to the next level</li>
<li><code>M l</code> demotes</li>
<li>You can create lists
<ol class="org-ol">
<li>onw</li>
<li>2</li>
<li>wooo</li>
<li>3</li>
</ol></li>
</ul>
</div>
</div>
<div id="outline-container-orgd86db83" class="outline-3">
<h3 id="orgd86db83"><span class="section-number-3">10.2.</span> Links, Hyperlinks and more</h3>
<div class="outline-text-3" id="text-10-2">
<ul class="org-ul">
<li><code>SPC m l</code> to add a link to an org page</li>
<li>You can add <code>::</code> to specify a heading or a line number</li>
<li>You can paste http links as well</li>
<li>You can “link” some text with specific code <code>SPC m l</code> elisp: <a href="(+ 2 2)">(+ 2 2)</a> when you click the link, emacs will evaluate the expression</li>
<li>Show <a href="org-agenda">My Agenda</a></li>
<li><a href="ls">List Files</a> in directory</li>
</ul>
</div>
</div>
<div id="outline-container-orgf2eac2b" class="outline-3">
<h3 id="orgf2eac2b"><span class="section-number-3">10.3.</span> Defining custoom Link Types</h3>
<div class="outline-text-3" id="text-10-3">
<ul class="org-ul">
<li><a href="https://youtube.com/watch?v=Febe4lUK5G4">Whatch the video about custom links</a></li>
</ul>
</div>
</div>
<div id="outline-container-org994f865" class="outline-3">
<h3 id="org994f865"><span class="section-number-3">10.4.</span> Linking to words & Bookmarks</h3>
<div class="outline-text-3" id="text-10-4">
<ul class="org-ul">
<li><code>SPC n l</code> stores a link to a particular headline</li>
</ul>
</div>
</div>
<div id="outline-container-org5149c05" class="outline-3">
<h3 id="org5149c05"><span class="section-number-3">10.5.</span> Code Snippets & Babel</h3>
<div class="outline-text-3" id="text-10-5">
<ul class="org-ul">
<li><code>SPC i s</code> for inserting code snippets
<ul class="org-ul">
<li><p>
Example:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"> <span style="color: #F92660;">(</span><span style="color: #9C91E4;">+</span> <span style="color: #9C91E4; font-weight: bold;">2</span> <span style="color: #9C91E4; font-weight: bold;">3</span> <span style="color: #9C91E4; font-weight: bold;">4</span> <span style="color: #9C91E4; font-weight: bold;">5</span><span style="color: #F92660;">)</span>
</pre>
</div></li>
</ul></li>
<li><code>C-c C-c</code> to execute the code.</li>
<li><code>SPC m '</code> to edit inside the babel in another buffer.</li>
<li>Results will show up in a <code>##+RESULTS</code> header</li>
<li>This feature is called Babel</li>
<li>One snippet can consume the output of another snippet</li>
<li>You can create your own snippets in the following directory: <code>~/.doom.d/snippets/</code></li>
</ul>
</div>
</div>
<div id="outline-container-org0527eeb" class="outline-3">
<h3 id="org0527eeb"><span class="section-number-3">10.6.</span> Task Management</h3>
<div class="outline-text-3" id="text-10-6">
<ul class="org-ul">
<li>Create a task by prefixing any heading with <code>TODO</code></li>
<li><code>DONE</code> means the task is done</li>
<li>You can create your custom key words by changing this variable: <code>org-todo-keywords</code>
<ul class="org-ul">
<li>remember you can get to your variables through <code>SPC h v</code> (M-x counsel-describe-variable)</li>
<li><p>
These values are already set in Doom:
</p>
<pre class="example" id="org7acc537">
((sequence "TODO(t)" "PROJ(p)" "STRT(s)" "WAIT(w)" "HOLD(h)" "|" "DONE(d)" "KILL(k)")
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))
</pre></li>
</ul></li>
<li><code>SPC m t</code> to change a status of a todo</li>
<li><code>SHIFT left</code> and <code>SHIFT right</code> can be used to change the status of a todo as well.</li>
<li>If you finish a task with a command, org mode will add a date that you “closed” the task.</li>
<li><code>SPC o a t</code> to open the agenda -> todo list</li>
<li><code>q</code> to quit</li>
<li><code>org-agenda-files</code> is a variable you can set to filter which files agenda searches for todos in.</li>
</ul>
</div>
<div id="outline-container-orgd401f1b" class="outline-4">
<h4 id="orgd401f1b"><span class="section-number-4">10.6.1.</span> Priorities for Tasks</h4>
<div class="outline-text-4" id="text-10-6-1">
<ul class="org-ul">
<li><code>SHIFT up</code> and <code>SHIFT down</code> will toggle the priority of tasks</li>
<li><code>org-fancy-priorities</code> gives you fancy looking priorities</li>
</ul>
</div>
</div>
<div id="outline-container-orgc9e3975" class="outline-4">
<h4 id="orgc9e3975"><span class="section-number-4">10.6.2.</span> Marking Tasks with Tags</h4>
<div class="outline-text-4" id="text-10-6-2">
<ul class="org-ul">
<li>Tags can be attached to any headlines</li>
<li><code>SPC m q</code> to tag a headline</li>
<li>Example:
<ul class="org-ul">
<li>TODO play more games :fun:</li>
</ul></li>
<li>Tags are hierarchical so nested headings will be tagged with the
parent header tag</li>
<li><code>org-tag-sparce-tree</code> will search for headings that only have a specific
tag</li>
</ul>
</div>
</div>
<div id="outline-container-org8616956" class="outline-4">
<h4 id="org8616956"><span class="section-number-4">10.6.3.</span> Setting a poperty for a task/headline</h4>
<div class="outline-text-4" id="text-10-6-3">
<ul class="org-ul">
<li><code>SPC m o</code> is used for setting a property.</li>
</ul>
</div>
<ol class="org-ol">
<li><a id="orgeb4b967"></a>Marking Headlines with Categories<br />
<div class="outline-text-5" id="text-10-6-3-1">
<ul class="org-ul">
<li>You can use <a href="https://orgmode.org/manual/Categories.html">categories</a> to change the label in agenda view.</li>
</ul>
</div>
</li>
<li><a id="orga3611b1"></a>Org-Habits<br />
<div class="outline-text-5" id="text-10-6-3-2">
<ul class="org-ul">
<li>If you want to <a href="https://orgmode.org/manual/Tracking-your-habits.html">keep track of your habits</a> using org mode, you can set the <code>STYLE</code> property to habit.
<ul class="org-ul">
<li>If you want to set a category (for chani</li>
</ul></li>
</ul>
</div>
</li>
</ol>
</div>
</div>
<div id="outline-container-org4422b97" class="outline-3">
<h3 id="org4422b97"><span class="section-number-3">10.7.</span> Lists</h3>
<div class="outline-text-3" id="text-10-7">
<ul class="org-ul">
<li>Two types of lists, ordered and unordered lists
<ul class="org-ul">
<li><code>SHIFT right</code> and <code>SHIFT left</code> can be used to change the type of lists.</li>
</ul></li>
<li>You can also change an unorded list by changing the first item to 1. and then typing <code>C-c C-c</code> and vice verca.</li>
</ul>
</div>
</div>
<div id="outline-container-org07f3b12" class="outline-3">
<h3 id="org07f3b12"><span class="section-number-3">10.8.</span> Checkboxes</h3>
<div class="outline-text-3" id="text-10-8">
<ul class="org-ul">
<li class="off"><code>[ ]</code> This is still todo</li>
<li class="trans"><code>[-]</code> This is in progress</li>
<li class="on"><code>[X]</code> This is a done task</li>
</ul>
</div>
<div id="outline-container-org65378d5" class="outline-4">
<h4 id="org65378d5"><span class="section-number-4">10.8.1.</span> You can see how many are done with a “cookie” <code>[1/2]</code></h4>
<div class="outline-text-4" id="text-10-8-1">
<ul class="org-ul">
<li class="trans"><code>[-]</code> Task 1</li>
<li class="on"><code>[X]</code> Task 2</li>
<li>You can do this by adding <code>[/]</code> to the heading and pressing <code>C-c C-c</code></li>
<li>You can’t assign a tag or a priority</li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-orga4062cb" class="outline-2">
<h2 id="orga4062cb"><span class="section-number-2">11.</span> Magit</h2>
<div class="outline-text-2" id="text-11">
<ul class="org-ul">
<li>magit is configured for you</li>
<li><code>SPC g g</code> to show Magit status Page</li>
<li>most commands are done from the status page</li>
<li>press <code>?</code> to see what you can do</li>
<li><code>git add -p</code> lets you stage in hunks</li>
<li>Open and close with the <code>TAB</code></li>
<li>Open diff view for a file with <code>TAB</code></li>
<li><code>s</code> to stage a change</li>
<li><code>u</code> to undo a change</li>
<li><code>c</code> to commit</li>
<li><code>b s</code> for branch and spinoff to create another branch, rewinding the
commits you made to master</li>
<li><code>b b</code> to switch branches</li>
</ul>
</div>
<div id="outline-container-org6233002" class="outline-3">
<h3 id="org6233002"><span class="section-number-3">11.1.</span> Git Commit Flow in More Detail</h3>
<div class="outline-text-3" id="text-11-1">
<ul class="org-ul">
<li><code>t t</code> to create a tag, default place is the commit you are currently
selecting</li>
<li><code>V</code> to select a change in a diff and <code>x</code> to discard that change.</li>
<li><code>s</code> to stage</li>
<li><code>c</code> to commit, you can <code>q</code> to quit the commit screen</li>
<li><code>P</code> to push and then <code>p</code> to your remote or <code>u</code> to a another remote</li>
</ul>
</div>
</div>
<div id="outline-container-org7f8a9d2" class="outline-3">
<h3 id="org7f8a9d2"><span class="section-number-3">11.2.</span> Magit with Forge for Issuing Pull Requests - Emacs</h3>
<div class="outline-text-3" id="text-11-2">
<ul class="org-ul">
<li>Forge is installed in emacs doom</li>
<li><code>@</code> for forge</li>
<li>Set up forge with <code>M x forge-pull</code>
<ul class="org-ul">
<li>the first time you will get a token from github</li>
</ul></li>
<li><code>@ c p</code> to create a pull request with forge
<ul class="org-ul">
<li>select the base branch</li>
<li>then select the target branch</li>
<li>then provide a short description</li>
<li><code>CTRL c CTRL c</code> to finish the pull request</li>
</ul></li>
<li>Now there will be a <code>pull requests</code> tab</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org8760360" class="outline-2">
<h2 id="org8760360"><span class="section-number-2">12.</span> Terminal</h2>
<div class="outline-text-2" id="text-12">
<ul class="org-ul">
<li>Set up vterm in your init.el file.</li>
<li><code>SPC o T</code> for opening vterm</li>
<li><code>SPC o t</code> for opening vterm in a popup window</li>
</ul>
</div>
</div>
<div id="outline-container-org1e70de6" class="outline-2">
<h2 id="org1e70de6"><span class="section-number-2">13.</span> File Tree</h2>
<div class="outline-text-2" id="text-13">
<ul class="org-ul">
<li>Set up neotree or treemacs in your init.el file.</li>
<li><code>SPC o p</code> for opening neotree or treemacs</li>
</ul>
</div>
</div>
<div id="outline-container-org3fae2c4" class="outline-2">
<h2 id="org3fae2c4"><span class="section-number-2">14.</span> Others</h2>
<div class="outline-text-2" id="text-14">
<ul class="org-ul">
<li><code>C-c C-z</code> to insert a note for a heading in org mode.</li>
</ul>
<ul class="org-ul">
<li><code>C-c C-c</code> to insert a tag for a heading in org mode.</li>
</ul>
</div>
</div>
<div id="outline-container-orgf7f34e7" class="outline-2">
<h2 id="orgf7f34e7"><span class="section-number-2">15.</span> Capturing</h2>
<div class="outline-text-2" id="text-15">
<ul class="org-ul">
<li><code>SPC X</code> to capture (the new thing gets caputured to a single file but that’s fine since we can easily refile it.)</li>
<li><code>SPC m r r</code> to refile</li>
</ul>
</div>
</div>
<div id="outline-container-org6b8c4b9" class="outline-2">
<h2 id="org6b8c4b9"><span class="section-number-2">16.</span> Org Roam</h2>
<div class="outline-text-2" id="text-16">
<p>
These keybinding only work after installing org-roam. To install org roam edit your <code>init.el</code> file and add <code>(org +roam2)</code> in its designated place. Watch <a href="https://www.youtube.com/watch?v=AyhPmypHDEw">this video</a> to understand what org-roam is.
</p>
<ul class="org-ul">
<li><code>SPC n r f</code> Find an existing node or create a new one.</li>
<li><code>SPC n r i</code> Insert a link to another node.</li>
<li><code>SPC n r r</code> Toggle backlinks pane</li>
<li><code>SPC m m o t</code> Add a roam tag.</li>
<li><code>SPC m m o a</code> Add a roam alias.</li>
</ul>
</div>
</div>
<div id="outline-container-org1e52724" class="outline-2">
<h2 id="org1e52724"><span class="section-number-2">17.</span> Sources</h2>
<div class="outline-text-2" id="text-17">
<ul class="org-ul">
<li><a href="https://www.youtube.com/watch?v=BRqjaN4-gGQ&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj&index=10">Link to youtube video series</a></li>
<li><a href="https://www.ianjones.us/zaiste-programming-doom-emacs-tutorial/#org7ad2452">This org file is mostly from the notes taken from the series above by ianjones.us</a></li>
</ul>
</div>
</div>
<div id="outline-container-orga354843" class="outline-2">
<h2 id="orga354843"><span class="section-number-2">18.</span> What to learn <code>[0/4]</code></h2>
<div class="outline-text-2" id="text-18">
<ul class="org-ul">
<li class="off"><code>[ ]</code> Org-journal</li>
<li class="off"><code>[ ]</code> <a href="https://orgroam.com">Org Roam</a></li>
<li class="off"><code>[ ]</code> abbrev-mode</li>
<li class="off"><code>[ ]</code> Org-super-agenda</li>
</ul>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Hossein Naghdbishi</p>
<p class="date">Created: 2021-11-17 Wed 00:14</p>
</div>
</body>
</html>