-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20220329153433-spacemacs_cheetsheet_march_2022.html
2410 lines (1996 loc) · 56.4 KB
/
20220329153433-spacemacs_cheetsheet_march_2022.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>
<!-- 2022-03-30 Wed 17:14 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Spacemacs cheetsheet March 2022</title>
<meta name="author" content="Muhammad Ridho" />
<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>
</head>
<body>
<div id="content" class="content">
<h1 class="title">Spacemacs cheetsheet March 2022</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="#org3135fc0">1. Use mirrors in China</a></li>
<li><a href="#org6f39aef">2. Visual selection</a></li>
<li><a href="#orgaef8281">3. Editing</a>
<ul>
<li><a href="#orgd167912">3.1. General Editing</a></li>
<li><a href="#orgb33f273">3.2. Programmer Editing</a></li>
</ul>
</li>
<li><a href="#org0ab1e4f">4. Navigation</a></li>
<li><a href="#org0991674">5. Narrowing</a></li>
<li><a href="#org1a33a38">6. Toggle Themes</a></li>
<li><a href="#orga3be4ce">7. Multi edit</a></li>
<li><a href="#org1a85527">8. iedit</a></li>
<li><a href="#org32922c1">9. Kill ring</a></li>
<li><a href="#org8c1f4b5">10. Magit, git</a></li>
<li><a href="#orgc540259">11. Files</a></li>
<li><a href="#org68a086f">12. Treemacs</a></li>
<li><a href="#org674db76">13. Ranger</a></li>
<li><a href="#orgedc0605">14. Buffers</a>
<ul>
<li><a href="#orgc9475d8">14.1. Remarks</a></li>
</ul>
</li>
<li><a href="#orgbb7c576">15. Layout</a></li>
<li><a href="#org21302b0">16. Bookmarks</a></li>
<li><a href="#org8472c52">17. Searching</a></li>
<li><a href="#org44e2f51">18. Undo tree</a></li>
<li><a href="#org38be143">19. Spacemacs Clojure mode key bindings</a>
<ul>
<li><a href="#org090a3cf">19.1. Lisp state</a></li>
</ul>
</li>
<li><a href="#orga8e8689">20. Snippet</a></li>
<li><a href="#orgcb402b6">21. Zoom / Adjust font size</a></li>
<li><a href="#orgf23c552">22. Org mode</a></li>
<li><a href="#org1fde913">23. Journal mode</a></li>
<li><a href="#org262d1bd">24. EasyPG Assistant</a></li>
<li><a href="#org7302d69">25. Macro</a></li>
<li><a href="#org197df6f">26. Project</a></li>
<li><a href="#orgbdd6805">27. Window management</a></li>
<li><a href="#org5bd993b">28. Toggle Emacs keybindings</a></li>
<li><a href="#org54e27af">29. Flycheck errors</a></li>
<li><a href="#org8b92f0d">30. Flutter</a></li>
<li><a href="#org9ddeea4">31. Rust</a></li>
<li><a href="#org916aec5">32. Python</a></li>
<li><a href="#org87ad49a">33. JavaScript</a></li>
<li><a href="#org7606a10">34. Graphviz</a></li>
<li><a href="#org6d34801">35. Add your own layer</a></li>
</ul>
</div>
</div>
<p>
Taken from: <a href="https://inflambda.tech/post/2020-11-12-spacemacs-keybinding.html">inflambda.tech</a>
</p>
<div id="outline-container-org3135fc0" class="outline-2">
<h2 id="org3135fc0"><span class="section-number-2">1.</span> Use mirrors in China</h2>
<div class="outline-text-2" id="text-1">
<p>
For users in China, use a mirror for spacemacs, this will save a lot time
downloading packages. Locate configuration-layer-elpa-archives in
<code>~/.spacemacs.d/init.el</code> and edit as follows:
</p>
<div class="org-src-container">
<pre class="src src-elisp"><span style="color: #4f97d7;">(</span><span style="color: #4f97d7; font-weight: bold;">setq</span> configuration-layer-elpa-archives
'<span style="color: #bc6ec5;">(</span><span style="color: #2d9574;">(</span><span style="color: #2d9574;">"melpa-cn"</span> . <span style="color: #2d9574;">"http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/"</span><span style="color: #2d9574;">)</span>
<span style="color: #2d9574;">(</span><span style="color: #2d9574;">"org-cn"</span> . <span style="color: #2d9574;">"http://mirrors.tuna.tsinghua.edu.cn/elpa/org/"</span><span style="color: #2d9574;">)</span>
<span style="color: #2d9574;">(</span><span style="color: #2d9574;">"gnu-cn"</span> . <span style="color: #2d9574;">"http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/"</span><span style="color: #2d9574;">)</span><span style="color: #bc6ec5;">)</span><span style="color: #4f97d7;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org6f39aef" class="outline-2">
<h2 id="org6f39aef"><span class="section-number-2">2.</span> Visual selection</h2>
<div class="outline-text-2" id="text-2">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">v</td>
<td class="org-left">Start visual selection, then use navigation keys to select region</td>
</tr>
<tr>
<td class="org-left">V</td>
<td class="org-left">Start visual selection by entire line(s)</td>
</tr>
<tr>
<td class="org-left">SPC v</td>
<td class="org-left">Start visual selection starting from current word, then use v / V to widen / narrow search.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgaef8281" class="outline-2">
<h2 id="orgaef8281"><span class="section-number-2">3.</span> Editing</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-orgd167912" class="outline-3">
<h3 id="orgd167912"><span class="section-number-3">3.1.</span> General Editing</h3>
<div class="outline-text-3" id="text-3-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">Key(s) Action</th>
<th scope="col" class="org-left"> </th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">I</td>
<td class="org-left">Edit from start of line</td>
</tr>
<tr>
<td class="org-left">A</td>
<td class="org-left">Edit from end of line</td>
</tr>
<tr>
<td class="org-left">i</td>
<td class="org-left">Edit before current character</td>
</tr>
<tr>
<td class="org-left">a</td>
<td class="org-left">Edit after current character</td>
</tr>
<tr>
<td class="org-left">o</td>
<td class="org-left">Edit by starting a new line below</td>
</tr>
<tr>
<td class="org-left">O</td>
<td class="org-left">Edit by starting a new line above</td>
</tr>
<tr>
<td class="org-left">c w</td>
<td class="org-left">Change current world</td>
</tr>
<tr>
<td class="org-left">4 c w</td>
<td class="org-left">Change 4 words starting from current word</td>
</tr>
<tr>
<td class="org-left">v c</td>
<td class="org-left">Change current character</td>
</tr>
<tr>
<td class="org-left">SPC v c</td>
<td class="org-left">Change current word</td>
</tr>
<tr>
<td class="org-left">SPC v d</td>
<td class="org-left">Delete current word</td>
</tr>
<tr>
<td class="org-left">C</td>
<td class="org-left">Change till the end of current line</td>
</tr>
<tr>
<td class="org-left">D</td>
<td class="org-left">Delete till the end of current line</td>
</tr>
<tr>
<td class="org-left">x p</td>
<td class="org-left">Transpose current character with next</td>
</tr>
<tr>
<td class="org-left">SPC x t c</td>
<td class="org-left">Transpose current character with previous</td>
</tr>
<tr>
<td class="org-left">SPC x t w</td>
<td class="org-left">Transpose current word with previous</td>
</tr>
<tr>
<td class="org-left">SPC x t l</td>
<td class="org-left">Transpose current line with previous</td>
</tr>
<tr>
<td class="org-left">SPC S c</td>
<td class="org-left">Spell check and change current word</td>
</tr>
<tr>
<td class="org-left">z =</td>
<td class="org-left">Spell check and change all occurrences of current word</td>
</tr>
<tr>
<td class="org-left">SPC j =</td>
<td class="org-left">Indent region or buffer</td>
</tr>
<tr>
<td class="org-left">SPC { d }</td>
<td class="org-left">Kill paragraph</td>
</tr>
<tr>
<td class="org-left">C-R "</td>
<td class="org-left">Paste from register in edit mode</td>
</tr>
<tr>
<td class="org-left">M-q</td>
<td class="org-left">Wrap line (This is hard wrap, for soft wrap use SPC t j)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgb33f273" class="outline-3">
<h3 id="orgb33f273"><span class="section-number-3">3.2.</span> Programmer Editing</h3>
<div class="outline-text-3" id="text-3-2">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">d a b</td>
<td class="org-left">Delete current s-expression</td>
</tr>
<tr>
<td class="org-left">d i b</td>
<td class="org-left">Delete the contents of current s-expression</td>
</tr>
<tr>
<td class="org-left">c a b</td>
<td class="org-left">Change current s-expression</td>
</tr>
<tr>
<td class="org-left">c i b</td>
<td class="org-left">Change the contents of current s-expression</td>
</tr>
<tr>
<td class="org-left">y a b</td>
<td class="org-left">Copy current s-expression</td>
</tr>
<tr>
<td class="org-left">y i b</td>
<td class="org-left">Copy the contents of current s-expression</td>
</tr>
<tr>
<td class="org-left">SPC k t</td>
<td class="org-left">Transpose current s-expression with previous</td>
</tr>
<tr>
<td class="org-left">g c c</td>
<td class="org-left">Comment current line</td>
</tr>
<tr>
<td class="org-left">M-;</td>
<td class="org-left">Add comment to the end of line</td>
</tr>
<tr>
<td class="org-left">%</td>
<td class="org-left">Jump to matching brackets</td>
</tr>
<tr>
<td class="org-left">C-k</td>
<td class="org-left">sp-kill-hybird-sexp, kill line respecting pair delimiters. Key biding works in normal modes in some major modes</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-org0ab1e4f" class="outline-2">
<h2 id="org0ab1e4f"><span class="section-number-2">4.</span> Navigation</h2>
<div class="outline-text-2" id="text-4">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">0</td>
<td class="org-left">Go to start of line</td>
</tr>
<tr>
<td class="org-left">^</td>
<td class="org-left">Go to first non-whitespace character in current line</td>
</tr>
<tr>
<td class="org-left">e</td>
<td class="org-left">End of world without trailing white space</td>
</tr>
<tr>
<td class="org-left">w</td>
<td class="org-left">End of word with trailing white space</td>
</tr>
<tr>
<td class="org-left">f/</td>
<td class="org-left">Go forward to the first occurrence of /</td>
</tr>
<tr>
<td class="org-left">M</td>
<td class="org-left">Go to middle of buffer</td>
</tr>
<tr>
<td class="org-left">H</td>
<td class="org-left">Go to head of buffer</td>
</tr>
<tr>
<td class="org-left">C-u</td>
<td class="org-left">Go up half a page</td>
</tr>
<tr>
<td class="org-left">C-d</td>
<td class="org-left">Go down half a page</td>
</tr>
<tr>
<td class="org-left">SPC j i</td>
<td class="org-left">List of functions/items in current buffer</td>
</tr>
<tr>
<td class="org-left">g d</td>
<td class="org-left">Goto definition</td>
</tr>
<tr>
<td class="org-left">C-o</td>
<td class="org-left">Go back</td>
</tr>
<tr>
<td class="org-left">C-i</td>
<td class="org-left">Go forward (Reverse of C-o)</td>
</tr>
<tr>
<td class="org-left">g ;</td>
<td class="org-left">Go to position of last edit</td>
</tr>
<tr>
<td class="org-left">m a</td>
<td class="org-left">Add a named marker a</td>
</tr>
<tr>
<td class="org-left">` a</td>
<td class="org-left">Go to mark a</td>
</tr>
<tr>
<td class="org-left">' a</td>
<td class="org-left">Go to the line with mark a</td>
</tr>
<tr>
<td class="org-left">:marks</td>
<td class="org-left">List all marks</td>
</tr>
<tr>
<td class="org-left">' '</td>
<td class="org-left">Go to last place</td>
</tr>
<tr>
<td class="org-left">SPC j j</td>
<td class="org-left">Jump by character</td>
</tr>
<tr>
<td class="org-left">SPC j l</td>
<td class="org-left">Jump by line</td>
</tr>
<tr>
<td class="org-left">C-y</td>
<td class="org-left">scroll down without moving cursor</td>
</tr>
<tr>
<td class="org-left">C-e</td>
<td class="org-left">Scroll up without moving cursor</td>
</tr>
<tr>
<td class="org-left">z t</td>
<td class="org-left">Put current line to top of buffer</td>
</tr>
<tr>
<td class="org-left">z b</td>
<td class="org-left">Put current line to bottom of buffer</td>
</tr>
<tr>
<td class="org-left">z z</td>
<td class="org-left">Put current line to center of buffer</td>
</tr>
<tr>
<td class="org-left">8 G</td>
<td class="org-left">Go to line by number</td>
</tr>
<tr>
<td class="org-left">z c</td>
<td class="org-left">Fold current block</td>
</tr>
<tr>
<td class="org-left">z o</td>
<td class="org-left">Unfold/Expand current block</td>
</tr>
<tr>
<td class="org-left">SPC t l</td>
<td class="org-left">Toggle line wrap, similar to soft wrap seen in other editors</td>
</tr>
<tr>
<td class="org-left">SPC t n v</td>
<td class="org-left">Toggle line numbers</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org0991674" class="outline-2">
<h2 id="org0991674"><span class="section-number-2">5.</span> Narrowing</h2>
<div class="outline-text-2" id="text-5">
<p>
Narrowing is very useful to many occasions, e.g., limiting search/replace
region, or focusing on function or block.
</p>
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC n f</td>
<td class="org-left">Narrow to function/block</td>
</tr>
<tr>
<td class="org-left">SPC n r</td>
<td class="org-left">Narrow to select region</td>
</tr>
<tr>
<td class="org-left">SPC n w</td>
<td class="org-left">Widen, use this to undo narrowing</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org1a33a38" class="outline-2">
<h2 id="org1a33a38"><span class="section-number-2">6.</span> Toggle Themes</h2>
<div class="outline-text-2" id="text-6">
<p>
You can edit themes by editing the values of dotspacemacs-themes in spacemacs
configuration file (SPC f e d), when emacs starts it will use the first theme as
default theme. A list of themes can be found at emacs-theme-gallery and
Spacemacs ThemesSpacemacs Themes. My current favorite dark theme is
cyberpunk. | |
</p>
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC T n</td>
<td class="org-left">Switch to next theme and open themes transition state, use n/p to preview next/previous theme.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orga3be4ce" class="outline-2">
<h2 id="orga3be4ce"><span class="section-number-2">7.</span> Multi edit</h2>
<div class="outline-text-2" id="text-7">
<p>
Evil multi-cursor (evil-mc) mode
</p>
<p>
Use visual selection to select world(s), then use C-p or C-n to select
occurrences above or below, then enter edit mode to edit multiple occurrences,
or use <code>g r q</code> to quit multi-edit mode, or use <code>g r p</code> or <code>g r n</code> to exclude
previous or next occurrence
</p>
</div>
</div>
<div id="outline-container-org1a85527" class="outline-2">
<h2 id="org1a85527"><span class="section-number-2">8.</span> iedit</h2>
<div class="outline-text-2" id="text-8">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC s e</td>
<td class="org-left">Edit all occurrence of the word under cursor.</td>
</tr>
</tbody>
</table>
<p>
Spacemacs will display the number of occurrences in the status bar. Use <code>ESC</code> to quit.
</p>
</div>
</div>
<div id="outline-container-org32922c1" class="outline-2">
<h2 id="org32922c1"><span class="section-number-2">9.</span> Kill ring</h2>
<div class="outline-text-2" id="text-9">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC r y</td>
<td class="org-left">Show kill ring (helm-show-kill-ring), i.e., list of copy/paste history</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org8c1f4b5" class="outline-2">
<h2 id="org8c1f4b5"><span class="section-number-2">10.</span> Magit, git</h2>
<div class="outline-text-2" id="text-10">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC g s</td>
<td class="org-left">Show git status</td>
</tr>
<tr>
<td class="org-left">s</td>
<td class="org-left">Add the highlighted file to staging</td>
</tr>
<tr>
<td class="org-left">c c</td>
<td class="org-left">Create a commit, edit commit message. Use , , to submit commit or use , k to cancel the commit.</td>
</tr>
<tr>
<td class="org-left">q</td>
<td class="org-left">Close magit window</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgc540259" class="outline-2">
<h2 id="orgc540259"><span class="section-number-2">11.</span> Files</h2>
<div class="outline-text-2" id="text-11">
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC f f</td>
<td class="org-left">Find file, use C-h to go to parent directory</td>
</tr>
<tr>
<td class="org-left">SPC p f</td>
<td class="org-left">Find file in current project</td>
</tr>
<tr>
<td class="org-left">SPC p k</td>
<td class="org-left">Kill project</td>
</tr>
<tr>
<td class="org-left">SPC f e d</td>
<td class="org-left">Open spacemacs configuration file</td>
</tr>
<tr>
<td class="org-left">SPC f e R</td>
<td class="org-left">Reload spacemacs configuration file</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org68a086f" class="outline-2">
<h2 id="org68a086f"><span class="section-number-2">12.</span> Treemacs</h2>
<div class="outline-text-2" id="text-12">
<p>
<code>treemacs</code> is for viewing and navigating project files.
</p>
<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">Key(s)</th>
<th scope="col" class="org-left">Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">SPC f t</td>
<td class="org-left">Open treemacs buffer. Type ? for more key bindings.</td>
</tr>
<tr>
<td class="org-left">SPC p t</td>
<td class="org-left">Open project root in treemacs buffer</td>
</tr>
<tr>
<td class="org-left">C-c C-p d</td>
<td class="org-left">Remove a project from treemacs buffer</td>
</tr>