-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.html
1011 lines (928 loc) · 38.1 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
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>
<!-- 2021-08-18 mié 08:21 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Learning Emacs Org-Mode</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Евгений Погребняк" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.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 #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
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-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>
<script type="text/javascript">
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
/*]]>*///-->
// @license-end
</script>
</head>
<body>
<div id="content">
<h1 class="title">Learning Emacs Org-Mode</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgeaa4cc6">1. Starting Emacs</a>
<ul>
<li><a href="#orgc3513c9">1.1. Options to run Emacs</a></li>
<li><a href="#orgcbf769f">1.2. Basic pipeline</a></li>
<li><a href="#orgcbed5b6">1.3. Improvements and changes</a>
<ul>
<li><a href="#org8d35738">1.3.1. <span class="done DONE">DONE</span> Configure terminal to avoid key conflicts</a></li>
<li><a href="#org627983a">1.3.2. <span class="done DONE">DONE</span> Set <code>org-support-shift-select</code> and CUA option</a></li>
<li><a href="#org2f74321">1.3.3. <span class="done DONE">DONE</span> Where is the config?</a></li>
<li><a href="#org54d5f6d">1.3.4. WIP Using X410 video system</a></li>
<li><a href="#org28dddd7">1.3.5. Avoid screen with tutorial</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org27a492c">2. Using Emacs</a>
<ul>
<li><a href="#orgbac1624">2.1. Make a selection, copy and paste selection</a></li>
<li><a href="#orgbf39d81">2.2. <span class="todo QUESTION">QUESTION</span> [C] Finding and replacing text</a></li>
<li><a href="#orgc937da9">2.3. <span class="todo QUESTION">QUESTION</span> [C] Working with windows</a></li>
<li><a href="#orgb9b7979">2.4. <span class="todo QUESTION">QUESTION</span> [A] How to select a vertical block of text?</a></li>
<li><a href="#orgfd1f50a">2.5. Run bash</a></li>
<li><a href="#orga56d4e4">2.6. <span class="todo QUESTION">QUESTION</span> [B] How to run some command from a command line?</a></li>
<li><a href="#org50c206f">2.7. <span class="done DONE">DONE</span> Refresh file from disk</a></li>
<li><a href="#org7b17b6f">2.8. Is there somethign similar to prettoer or black code formatter for org files?</a></li>
</ul>
</li>
<li><a href="#org0c7fcdc">3. Using orgmode</a>
<ul>
<li><a href="#org551d6fc">3.1. <TAB> is all you need</a></li>
<li><a href="#org8db204e">3.2. Getting around headers</a></li>
<li><a href="#hyperlink_target">3.3. Create a hyperlink</a></li>
<li><a href="#org1bd13d2">3.4. Use timestamps</a></li>
<li><a href="#org7ffaf2f">3.5. Checkboxes</a></li>
<li><a href="#orgbea3446">3.6. Agenda</a></li>
<li><a href="#org44888f9">3.7. Clocking</a></li>
<li><a href="#orgc2a0de1">3.8. Table</a></li>
<li><a href="#orgecd2856">3.9. Calendar</a></li>
<li><a href="#org909a707">3.10. Other actions</a></li>
</ul>
</li>
<li><a href="#org2e892c2">4. <span class="todo QUESTION">QUESTION</span> [A] Useful scenarios</a></li>
<li><a href="#orgb11fb8e">5. Reference</a>
<ul>
<li><a href="#org2de898c">5.1. Concepts</a></li>
<li><a href="#org5339eb2">5.2. Notation</a></li>
</ul>
</li>
<li><a href="#org1fae581">6. Links</a>
<ul>
<li><a href="#org5033451">6.1. Videos</a></li>
<li><a href="#org8b9ed37">6.2. Blogs and success stories</a></li>
<li><a href="#orga1f8f57">6.3. Orgfiles on github</a></li>
</ul>
</li>
<li><a href="#orgb706461">7. Out of scope</a></li>
<li><a href="#org4c793ce">8. Appendix.</a>
<ul>
<li><a href="#org257bfd6">8.1. Key binding cheatsheet</a></li>
<li><a href="#orgc5b90b5">8.2. Emacs commands</a></li>
</ul>
</li>
</ul>
</div>
</div>
<p>
In this file I add new things I learn about Emacs and orgmode.
<code>QUESTION</code> and <code>#FIXME</code> mark section where help is needed.
</p>
<div id="outline-container-orgeaa4cc6" class="outline-2">
<h2 id="orgeaa4cc6"><span class="section-number-2">1</span> Starting Emacs</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-orgc3513c9" class="outline-3">
<h3 id="orgc3513c9"><span class="section-number-3">1.1</span> Options to run Emacs</h3>
<div class="outline-text-3" id="text-1-1">
<ul class="org-ul">
<li class="on"><code>[X]</code> WSL in terminal (I use cmder) with bash (Ubuntu)</li>
<li class="on"><code>[X]</code> XServ graphics</li>
<li class="on"><code>[X]</code> VSCode extension (no agenda view)</li>
<li class="on"><code>[X]</code> Windows terminal executable (not WSL, just cmd/cmder)</li>
<li class="off"><code>[ ]</code> Windows MSI executable (bad Russian font spacing)</li>
<li class="on"><code>[X]</code> Mobile: Android + Termux + Emacs (You will probably need something like Hacker's Keyboard to input the shortcuts effectively)</li>
</ul>
<p>
Console vs teminal vs shell.
</p>
</div>
</div>
<div id="outline-container-orgcbf769f" class="outline-3">
<h3 id="orgcbf769f"><span class="section-number-3">1.2</span> Basic pipeline</h3>
<div class="outline-text-3" id="text-1-2">
<ul class="org-ul">
<li>Install emacs on WSL with <code>sudo apt-get install emacs</code></li>
<li>Launch emacs with <code>emacs -nw <FILENAME.org></code> command</li>
<li>Open a file with F10 - File menu</li>
<li>Edit file</li>
<li>Save file <b>C-x C-s</b></li>
<li>Exit Emacs <b>C-x C-c</b></li>
</ul>
</div>
</div>
<div id="outline-container-orgcbed5b6" class="outline-3">
<h3 id="orgcbed5b6"><span class="section-number-3">1.3</span> Improvements and changes</h3>
<div class="outline-text-3" id="text-1-3">
</div>
<div id="outline-container-org8d35738" class="outline-4">
<h4 id="org8d35738"><span class="section-number-4">1.3.1</span> <span class="done DONE">DONE</span> Configure terminal to avoid key conflicts</h4>
<div class="outline-text-4" id="text-1-3-1">
<p>
Must configure terminal to resolve
<a href="https://emacs.stackexchange.com/questions/68105/how-to-use-ctrl-c-on-wsl-key-binding-conflict">key binding conflicts</a>
like Ctrl-C.
</p>
</div>
</div>
<div id="outline-container-org627983a" class="outline-4">
<h4 id="org627983a"><span class="section-number-4">1.3.2</span> <span class="done DONE">DONE</span> Set <code>org-support-shift-select</code> and CUA option</h4>
<div class="outline-text-4" id="text-1-3-2">
<ul class="org-ul">
<li>Selection with Shift is already built-in part of Emacs, but not org-mode</li>
<li>Start with 'M-x customize' to find options about Shift selection</li>
<li>Set CUA (Ctrl-Z/X/C/V) as part of F10 menu</li>
<li>Save options</li>
<li>See also <code>org-disputed-keys</code> in <a href="https://orgmode.org/manual/Conflicts.html">Orgmode conflicts</a>.</li>
</ul>
</div>
</div>
<div id="outline-container-org2f74321" class="outline-4">
<h4 id="org2f74321"><span class="section-number-4">1.3.3</span> <span class="done DONE">DONE</span> Where is the config?</h4>
<div class="outline-text-4" id="text-1-3-3">
<p>
Use just one, any of them:
</p>
<ul class="org-ul">
<li>~/.emacs is a config file</li>
<li>~/.emacs.d is a directory with init.el</li>
</ul>
</div>
</div>
<div id="outline-container-org54d5f6d" class="outline-4">
<h4 id="org54d5f6d"><span class="section-number-4">1.3.4</span> WIP Using X410 video system</h4>
<div class="outline-text-4" id="text-1-3-4">
<ul class="org-ul">
<li><a href="https://emacsredux.com/blog/2020/09/23/using-emacs-on-windows-with-wsl2/">Original article with X410 recommendation</a></li>
<li>On WSL 1 works at <a href="https://x410.dev/cookbook/wsl/using-x410-with-wsl2/">127.0.0.1</a></li>
<li>X410 is available form Windows Store (USD10 with discount),
it saves a ton of time for configuration, including the fonts.</li>
</ul>
</div>
<ol class="org-ol">
<li><a id="org92994d6"></a><span class="todo QUESTION">QUESTION</span> [A] Change keyboard layout in X410<br />
<div class="outline-text-5" id="text-1-3-4-1">
<ul class="org-ul">
<li><a href="https://x410.dev/cookbook/keyboard-layout/">Selecting a Keyboard Layout</a></li>
<li>This page details the use of the <code>setxkbmap</code> command to set X410 keyboard layout. By example, to set keyboard layout to Russian, the command is <code>setxkbmap ru</code>.</li>
</ul>
<p>
TODO: issue 1.
</p>
</div>
</li>
</ol>
</div>
<div id="outline-container-org28dddd7" class="outline-4">
<h4 id="org28dddd7"><span class="section-number-4">1.3.5</span> Avoid screen with tutorial</h4>
<div class="outline-text-4" id="text-1-3-5">
<p>
Kill it with <b>C-x 1</b> or try <code>(setq inhibit-splash-screen t)</code>
</p>
<p>
TODO: open .emacs in Emacs
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-org27a492c" class="outline-2">
<h2 id="org27a492c"><span class="section-number-2">2</span> Using Emacs</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-orgbac1624" class="outline-3">
<h3 id="orgbac1624"><span class="section-number-3">2.1</span> Make a selection, copy and paste selection</h3>
<div class="outline-text-3" id="text-2-1">
<p>
You can configure orgmode to use Shift-arrows for selection.
See <code>org-support-shift-select</code>.
</p>
</div>
</div>
<div id="outline-container-orgbf39d81" class="outline-3">
<h3 id="orgbf39d81"><span class="section-number-3">2.2</span> <span class="todo QUESTION">QUESTION</span> [C] Finding and replacing text</h3>
<div class="outline-text-3" id="text-2-2">
<p>
Unsure how it works on emacs, is it C-s? What about replace?
Please recommend some tutorial on this?
</p>
</div>
</div>
<div id="outline-container-orgc937da9" class="outline-3">
<h3 id="orgc937da9"><span class="section-number-3">2.3</span> <span class="todo QUESTION">QUESTION</span> [C] Working with windows</h3>
<div class="outline-text-3" id="text-2-3">
<p>
I currently use <Remove other windows> from File menu.
Maybe I can do better.
</p>
</div>
</div>
<div id="outline-container-orgb9b7979" class="outline-3">
<h3 id="orgb9b7979"><span class="section-number-3">2.4</span> <span class="todo QUESTION">QUESTION</span> [A] How to select a vertical block of text?</h3>
<div class="outline-text-3" id="text-2-4">
<p>
Similar to Alt-Shift-arrows in Notepad++.
</p>
<ul class="org-ul">
<li><a href="https://stackoverflow.com/questions/25065328/how-select-a-rectangle-in-emacs">How to select a rectangle in emacs</a>
Most voted answer (53 votes) said that <b>C-x SPC</b> starts <code>rectangle-mark-mode</code> that is similar to the functionality you request from Notepad++, but with all the operations available to Emacs. The selected rectangle can be copied with <b>M-w</b> or killed with <b>C-w</b>, by example.
More information <a href="http://emacsredux.com/blog/2014/01/01/a-peek-at-emacs-24-dot-4-rectangular-selection/">here</a>.</li>
</ul>
</div>
</div>
<div id="outline-container-orgfd1f50a" class="outline-3">
<h3 id="orgfd1f50a"><span class="section-number-3">2.5</span> Run bash</h3>
<div class="outline-text-3" id="text-2-5">
<p>
~M-X shell
</p>
</div>
</div>
<div id="outline-container-orga56d4e4" class="outline-3">
<h3 id="orga56d4e4"><span class="section-number-3">2.6</span> <span class="todo QUESTION">QUESTION</span> [B] How to run some command from a command line?</h3>
<div class="outline-text-3" id="text-2-6">
<p>
Imagine I needed something like
</p>
<p>
~emacs README.md –run "C-c C-e h h"
</p>
<p>
How would it do it? Using emacs lisp?
</p>
</div>
</div>
<div id="outline-container-org50c206f" class="outline-3">
<h3 id="org50c206f"><span class="section-number-3">2.7</span> <span class="done DONE">DONE</span> Refresh file from disk</h3>
<div class="outline-text-3" id="text-2-7">
<p>
The command is <b>M-x revert-buffer</b>
(<a href="https://emacs.stackexchange.com/questions/169/how-do-i-reload-a-file-in-a-buffer">details</a>).
</p>
</div>
</div>
<div id="outline-container-org7b17b6f" class="outline-3">
<h3 id="org7b17b6f"><span class="section-number-3">2.8</span> Is there somethign similar to prettoer or black code formatter for org files?</h3>
<div class="outline-text-3" id="text-2-8">
<p>
M-x revert-buffer
</p>
</div>
</div>
</div>
<div id="outline-container-org0c7fcdc" class="outline-2">
<h2 id="org0c7fcdc"><span class="section-number-2">3</span> Using orgmode</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-org551d6fc" class="outline-3">
<h3 id="org551d6fc"><span class="section-number-3">3.1</span> <TAB> is all you need</h3>
<div class="outline-text-3" id="text-3-1">
<ul class="org-ul">
<li>TAB shows/hides headers (quite powerful!)</li>
<li>Shift-TAB opens all headers</li>
</ul>
</div>
</div>
<div id="outline-container-org8db204e" class="outline-3">
<h3 id="org8db204e"><span class="section-number-3">3.2</span> Getting around headers</h3>
<div class="outline-text-3" id="text-3-2">
<ul class="org-ul">
<li>Alt + left or right changes header level</li>
<li>Alt + up or down moves lines around</li>
<li>Shift - arrow:
<ul class="org-ul">
<li>changes list numbering style</li>
<li>cycles TODO-DONE in header</li>
<li>selects in CUA mode</li>
</ul></li>
</ul>
</div>
<ol class="org-ol">
<li><a id="orga91d839"></a><span class="todo WAITING">WAITING</span> Move line across headers beyond own section<br />
<div class="outline-text-5" id="text-3-2-0-1">
<ul class="org-ul">
<li>Alt - arrow has limits within a header</li>
<li>In VS Code Alt Up/Down move line wherever</li>
<li>Is there some key combination that moves lines across file</li>
<li>Currently using C-k C-y</li>
<li>Shift-Arrow-Up/Down maybe?</li>
<li><a href="https://emacs.stackexchange.com/questions/68140/unrestricted-movement-of-lines-alt-up-down">https://emacs.stackexchange.com/questions/68140/unrestricted-movement-of-lines-alt-up-down</a></li>
</ul>
</div>
</li>
</ol>
</div>
<div id="outline-container-hyperlink_target" class="outline-3">
<h3 id="hyperlink_target"><span class="section-number-3">3.3</span> Create a hyperlink</h3>
<div class="outline-text-3" id="text-hyperlink_target">
<ul class="org-ul">
<li>Use <code>[[url][]]</code> syntax or C-c C-l</li>
<li>Internal <a href="#hyperlink_target">hyperlink here</a></li>
<li>Or <a href="ARCHIVE.html">link to file</a></li>
<li><a href="https://gist.github.com/will-henney/d8564133e07e546789c0">Link example</a></li>
</ul>
</div>
</div>
<div id="outline-container-org1bd13d2" class="outline-3">
<h3 id="org1bd13d2"><span class="section-number-3">3.4</span> Use timestamps</h3>
<div class="outline-text-3" id="text-3-4">
<p>
SCHEDULED: <span class="timestamp-wrapper"><span class="timestamp"><2021-08-15 dom></span></span>
</p>
<p>
As <a href="https://orgmode.org/guide/Creating-Timestamps.html#Creating-Timestamps">guide</a> suggests:
</p>
<ul class="org-ul">
<li><b>C-c .</b> for active date-only timestamp (Active = it creates an entry on Org agenda)</li>
<li><b>C-c !</b> for inactive date-only timestamp (Inactive = it doesn't create entries on Org agenda)</li>
<li><b>S-arrow</b> for change</li>
</ul>
</div>
<ol class="org-ol">
<li><a id="org2b0f5d3"></a><span class="todo QUESTION">QUESTION</span> [A] How to put a timestamp with time, not just date?<br />
<div class="outline-text-5" id="text-3-4-0-1">
<ul class="org-ul">
<li><b>C-u C-c .</b> and <b>C-u C-c !</b> for timestamp including date and time, active and inactive respectively</li>
</ul>
</div>
</li>
</ol>
</div>
<div id="outline-container-org7ffaf2f" class="outline-3">
<h3 id="org7ffaf2f"><span class="section-number-3">3.5</span> Checkboxes</h3>
<div class="outline-text-3" id="text-3-5">
<ul class="org-ul">
<li>You must type <code>[0/0]</code> or <code>[0%]</code> for checkbox</li>
<li>Only X counts for completion, not `x` or `+`</li>
<li>C-c C-c toggles and recalculates</li>
<li>QUESTION: what can recalculate on its own?</li>
<li>Check Rainer König video <a href="https://www.youtube.com/watch?v=gvgfmED8RD4&list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE&index=5&t=444s">OrgMode E01S05: Checklists</a></li>
</ul>
<p>
Sample checkbox list <code>[2/3]</code>, <code>[66%]</code>:
</p>
<ul class="org-ul">
<li class="on"><code>[X]</code> Item 1</li>
<li class="on"><code>[X]</code> Item 2</li>
<li class="off"><code>[ ]</code> Item 3</li>
</ul>
</div>
</div>
<div id="outline-container-orgbea3446" class="outline-3">
<h3 id="orgbea3446"><span class="section-number-3">3.6</span> Agenda</h3>
<div class="outline-text-3" id="text-3-6">
<ul class="org-ul">
<li>Use F10 and menu for agenda view</li>
</ul>
</div>
<ol class="org-ol">
<li><a id="org710a159"></a><span class="todo QUESTION">QUESTION</span> [A] Unsolved about agenda:<br />
<div class="outline-text-5" id="text-3-6-0-1">
<ul class="org-ul">
<li class="on"><code>[X]</code> Why is C-c a undefined? Shoud I define it?
Seems to be undefined by default, but <a href="https://orgmode.org/guide/Introduction.html#Activation">this page of the Org mode guide</a> says that with <code>(global-set-key (kbd "C-c a") 'org-agenda)</code> can be set. If the keyboard shortcut isn't activated, you can activate the agenda view manually with <b>M-x org-agenda</b>.</li>
<li class="off"><code>[ ]</code> <p>
How to sort agenda by priority?
<a href="https://emacs.stackexchange.com/questions/32430/how-to-sort-habits-by-priority-in-the-org-agenda-view">This Emacs Stackexchange question</a> shows Emacs-Lisp code to make sorting by priority the default in agenda view
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(defun hw-org-agenda-sort-habits (a b)
"Sort habits first by user priority, then by schedule+deadline+consistency."
(let ((ha (get-text-property 1 'org-habit-p a))
(hb (get-text-property 1 'org-habit-p b)))
(when (and ha hb)
(let ((pa (org-get-priority a))
(pb (org-get-priority b)))
(cond ((> pa pb) +1)
((< pa pb) -1)
((= pa pb) (org-cmp-values a b 'priority)))))))
(setq org-agenda-cmp-user-defined 'hw-org-agenda-sort-habits
org-agenda-sorting-strategy '((agenda time-up user-defined-down habit-down)
(todo priority-down category-keep)
(tags priority-down category-keep)
(search category-keep)))
</pre>
</div></li>
<li class="on"><code>[X]</code> How to close agenda buffer?
In Emacs you close a buffer with <b>C-x k</b></li>
<li class="on"><code>[X]</code> How to move across buffers?
<ul class="org-ul">
<li><b>C-x o</b> move to the other window</li>
<li><b>C-x 1</b> maximixe current buffer</li>
<li><b>C-x 2</b> split current window vertically</li>
<li><b>C-x 3</b> split current window horizontally</li>
<li><b>C-x b</b> ask for the name of a buffer and display it in current window</li>
<li><b>C-x B</b> split current window and show a buffer list in the other window</li>
</ul></li>
</ul>
</div>
</li>
</ol>
</div>
<div id="outline-container-org44888f9" class="outline-3">
<h3 id="org44888f9"><span class="section-number-3">3.7</span> Clocking</h3>
<div class="outline-text-3" id="text-3-7">
<p>
<b>*</b> Clock this!
</p>
<ul class="org-ul">
<li>Start: C-c C-x C-i</li>
<li>End: C-c C-x C-o</li>
</ul>
<blockquote>
<p>
It is easy to “clock-in” to a particular task by positioning point within an item
and typing C-c C-x C-i and clocking out with C-c C-x C-o.
</p>
</blockquote>
<p>
<a href="https://www.adventuresinwhy.com/post/org-mode-timekeeping/">https://www.adventuresinwhy.com/post/org-mode-timekeeping/</a>
</p>
</div>
<ol class="org-ol">
<li><a id="orgb9536fc"></a><span class="todo QUESTION">QUESTION</span> [B] What are useful habit with clocking?<br />
<div class="outline-text-5" id="text-3-7-0-1">
<ul class="org-ul">
<li>Does pomodoro help? <i>In the same way the body cannot sustain exercise indefinitely, but needs to rest after a period of sustained effort, so does the brain. So pomodoro is a good practice, but you need to tailor the focus and rest periods to your personal optimum.</i></li>
</ul>
</div>
</li>
</ol>
</div>
<div id="outline-container-orgc2a0de1" class="outline-3">
<h3 id="orgc2a0de1"><span class="section-number-3">3.8</span> Table</h3>
<div class="outline-text-3" id="text-3-8">
<ul class="org-ul">
<li>Start table from menu</li>
<li>C-c C-c to format</li>
</ul>
</div>
</div>
<div id="outline-container-orgecd2856" class="outline-3">
<h3 id="orgecd2856"><span class="section-number-3">3.9</span> Calendar</h3>
<div class="outline-text-3" id="text-3-9">
<p>
How to view calendar (it was popping up accidantally when I hit something wrong).
</p>
</div>
</div>
<div id="outline-container-org909a707" class="outline-3">
<h3 id="org909a707"><span class="section-number-3">3.10</span> Other actions</h3>
<div class="outline-text-3" id="text-3-10">
<ul class="org-ul">
<li>Sort this list is C-c ^</li>
<li>Add cycling todo tags <code>#+SEQ_TODO:</code></li>
<li>Archive tasks through Org menu</li>
<li>Defintion list with <code>::</code> separator</li>
<li>Github search for org files with <code>[[https://github.com/search?o=asc&q=language%3Aorg&s=indexed&type=Code][language:org]]</code></li>
<li>C-k C-y can move lines</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org2e892c2" class="outline-2">
<h2 id="org2e892c2"><span class="section-number-2">4</span> <span class="todo QUESTION">QUESTION</span> [A] Useful scenarios</h2>
<div class="outline-text-2" id="text-4">
<p>
What are productive scenarios for using org-mode?
</p>
<p>
-<a href="https://www.reddit.com/r/emacs/comments/42qr9h/orgmode_for_gtd/d0fupy5?utm_source=share&utm_medium=web2x&context=3"> @Trevoke via reddit</a>:
</p>
<blockquote>
<p>
The best advice I've heard for using org-mode in some sort of GTD system
was not to try and set up categories when you start.
Start with just a bunch of TODOs, and slowly grow the system as you feel the need to.
</p>
</blockquote>
<ul class="org-ul">
<li>As a general notebook for brainstorming and keeping interesting ideas at hand.</li>
<li>Org mode can execute code in several programming languages, so it can also be used to automate tasks that require collections of scripts.</li>
<li>It can even be used as database client for SQL databases, and the result of SQL queries can be shown in Org tables.</li>
<li>To measure your productivity by tabulating hourly, weekly, daily views on your clock-ins and clock-outs.</li>
<li>Alongside existing productivity methodologies like GTD</li>
</ul>
</div>
</div>
<div id="outline-container-orgb11fb8e" class="outline-2">
<h2 id="orgb11fb8e"><span class="section-number-2">5</span> Reference</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-org2de898c" class="outline-3">
<h3 id="org2de898c"><span class="section-number-3">5.1</span> Concepts</h3>
<div class="outline-text-3" id="text-5-1">
<dl class="org-dl">
<dt>buffer</dt><dd>a screen that represents a file or Emacs own output</dd>
<dt>frame</dt><dd>is a new window for the whole program</dd>
<dt>modeline</dt><dd>a line at the bottom of a screen with something like <code>-UUU(DOS)**--F1</code></dd>
<dt>window</dt><dd>is a windows inside editor</dd>
</dl>
</div>
</div>
<div id="outline-container-org5339eb2" class="outline-3">
<h3 id="org5339eb2"><span class="section-number-3">5.2</span> Notation</h3>
<div class="outline-text-3" id="text-5-2">
<ul class="org-ul">
<li>* is a header</li>
<li>drawer box has :NAME: and :END:</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org1fae581" class="outline-2">
<h2 id="org1fae581"><span class="section-number-2">6</span> Links</h2>
<div class="outline-text-2" id="text-6">
</div>
<div id="outline-container-org5033451" class="outline-3">
<h3 id="org5033451"><span class="section-number-3">6.1</span> Videos</h3>
<div class="outline-text-3" id="text-6-1">
<p>
New:
</p>
<ul class="org-ul">
<li><a href="https://cestlaz.github.io/stories/emacs/">https://cestlaz.github.io/stories/emacs/</a></li>
</ul>
<p>
Essential:
</p>
<ul class="org-ul">
<li><a href="https://www.youtube.com/watch?v=oJTwQvgfgMM">Carsten Dominik keynote (2008)</a></li>
<li><a href="https://www.youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE">Rainer König lesson series</a></li>
</ul>
<p>
Extension:
</p>
<ul class="org-ul">
<li><a href="https://www.youtube.com/watch?v=JWD1Fpdd4Pc">Evil Mode: Or, How I Learned to Stop Worrying and Love Emacs</a></li>
<li><a href="https://www.youtube.com/watch?v=ZbxUJz6a9Io">Andrew Tropin - Modern Emacs (2021)</a></li>
</ul>
<p>
Academic:
</p>
<ul class="org-ul">
<li><a href="https://arxiv.org/abs/2008.06030">On the design of text editors</a></li>
</ul>
</div>
</div>
<div id="outline-container-org8b9ed37" class="outline-3">
<h3 id="org8b9ed37"><span class="section-number-3">6.2</span> Blogs and success stories</h3>
<div class="outline-text-3" id="text-6-2">
<ul class="org-ul">
<li><a href="https://sachachua.com/blog/2014/01/tips-learning-org-mode-emacs/">https://sachachua.com/blog/2014/01/tips-learning-org-mode-emacs/</a></li>
<li><a href="https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html">https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html</a></li>
</ul>
</div>
<ol class="org-ol">
<li><a id="orgd7a5d5e"></a><span class="todo TODO">TODO</span> [C] add images from sachachua.com<br /></li>
<li><a id="org46e225c"></a><span class="todo TODO">TODO</span> [C] redraw mindmap to simplify<br /></li>
</ol>
</div>
<div id="outline-container-orga1f8f57" class="outline-3">
<h3 id="orga1f8f57"><span class="section-number-3">6.3</span> Orgfiles on github</h3>
<div class="outline-text-3" id="text-6-3">
<ul class="org-ul">
<li><a href="https://github.com/abcdw/notes/blob/master/notes/20210805075718-the_modern_emacs.org">https://github.com/abcdw/notes/blob/master/notes/20210805075718-the_modern_emacs.org</a></li>
<li><a href="https://github.com/zkat/sheeple/blob/5393c74737ccf22c3fd5f390076b75c38453cb04/presentation/sheeple-talk-22-10-09.org">https://github.com/zkat/sheeple/blob/5393c74737ccf22c3fd5f390076b75c38453cb04/presentation/sheeple-talk-22-10-09.org</a></li>
<li><a href="https://raw.githubusercontent.com/ymd-h/cpprb/c44cf5d53f807e58f71d1a2e1cf46aa92b5e193d/README.org">https://raw.githubusercontent.com/ymd-h/cpprb/c44cf5d53f807e58f71d1a2e1cf46aa92b5e193d/README.org</a></li>
<li><a href="https://raw.githubusercontent.com/deopurkar/ag2021/f73c35fede17a123806102306ce0c47bc2a87cd9/course.org">https://raw.githubusercontent.com/deopurkar/ag2021/f73c35fede17a123806102306ce0c47bc2a87cd9/course.org</a></li>
<li><a href="https://raw.githubusercontent.com/Literate-DevOps/literate-programming-tutorials/0dcff18ae2047fb46df1edc2cde7b2ea0cb57a12/how-to/01-assassinate-the-archbishop-of-canterbury-in-1170-ce/how-to-assassinate-the-archbishop-of-canterbury-in-1170-ce.org">https://raw.githubusercontent.com/Literate-DevOps/literate-programming-tutorials/0dcff18ae2047fb46df1edc2cde7b2ea0cb57a12/how-to/01-assassinate-the-archbishop-of-canterbury-in-1170-ce/how-to-assassinate-the-archbishop-of-canterbury-in-1170-ce.org</a></li>
</ul>
</div>
</div>
</div>
<div id="outline-container-orgb706461" class="outline-2">
<h2 id="orgb706461"><span class="section-number-2">7</span> Out of scope</h2>
<div class="outline-text-2" id="text-7">
<p>
I try to avoid more complicated topics:
</p>
<ul class="org-ul">
<li>packages and complex configuration</li>
<li>programming in lisp</li>
<li>spacemacs, emacs-doom and similar</li>
</ul>
<ul class="org-ul">
<li>org-roam</li>
<li>org-capture</li>
<li>email with gnus</li>
<li>git with magit</li>
<li>export to latex and beamer</li>
</ul>
</div>
</div>
<div id="outline-container-org4c793ce" class="outline-2">
<h2 id="org4c793ce"><span class="section-number-2">8</span> Appendix.</h2>
<div class="outline-text-2" id="text-8">
</div>
<div id="outline-container-org257bfd6" class="outline-3">
<h3 id="org257bfd6"><span class="section-number-3">8.1</span> Key binding cheatsheet</h3>
<div class="outline-text-3" id="text-8-1">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Command</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">M-x <command></td>
<td class="org-left">Run command by name</td>
</tr>
<tr>
<td class="org-left">M-x shell</td>
<td class="org-left">Run Shell</td>
</tr>
<tr>
<td class="org-left">F10</td>
<td class="org-left">Upper menu</td>
</tr>
<tr>
<td class="org-left">C-s</td>
<td class="org-left">Advanced search</td>
</tr>
<tr>
<td class="org-left">C-c C-c</td>
<td class="org-left">Toggle or recalculate</td>
</tr>
<tr>
<td class="org-left">C-k C-y</td>
<td class="org-left">Kill and undo line</td>
</tr>
<tr>
<td class="org-left">C-c C-e h h</td>
<td class="org-left">Create HTML</td>
</tr>
<tr>
<td class="org-left">C-x 1</td>
<td class="org-left">Remove window</td>
</tr>
<tr>
<td class="org-left"><b>Way out</b></td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">C-g</td>
<td class="org-left">Kill, stop or exit</td>
</tr>
<tr>
<td class="org-left">ESC-ESC-ESC</td>
<td class="org-left">Exit (hopefully)</td>
</tr>
<tr>
<td class="org-left">q</td>
<td class="org-left">Exit (sometimes)</td>
</tr>
<tr>
<td class="org-left"><b>Not Emacs:</b></td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">Fn-Esc</td>
<td class="org-left">Lock Fn key (Lenovo)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgc5b90b5" class="outline-3">
<h3 id="orgc5b90b5"><span class="section-number-3">8.2</span> Emacs commands</h3>
<div class="outline-text-3" id="text-8-2">
<p>
M-x:
</p>
<ul class="org-ul">
<li>revert-buffer (in File menu)</li>
<li>customize</li>
<li>shell</li>
<li>query-replace-regexp (Asks for a regular expression, replaces it, its very powerful to automate editing tasks)</li>
</ul>