-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
executable file
·1327 lines (1079 loc) · 42.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
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
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Tab</title>
<meta name="description" content="Vim Tips by Adam Morse" />
<meta name="author" content="Alex Baldwin" />
<link rel="shortcut icon" href="icon/128.png">
<link rel="stylesheet" type="text/css" href="css/basscss.min.css" />
<link rel="stylesheet" type="text/css" href="css/component.css" />
<script src="js/modernizr.custom.js"></script>
<script src="js/ga.js"></script>
</head>
<body>
<div class="table">
<div class="table-cell">
<div id="cbp-qtrotator" class="cbp-qtrotator">
<div class="cbp-qtcontent">
<blockquote>
<p><code>a</code> enter into insert mode after the character your cursor is on.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>A</code> enter into insert mode at the end of the current line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>b</code> move cursor to first character of previous word.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>B</code> move cursor to first character of previous non-blank series of characters.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-b></code> scroll page backwards (move up in the file).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>c stands for “change” will not do anything on its own, but acts as a modifier to other commands. Here are some common commands handy for editing front end code.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>cw</code> cw stands for change word. This will delete the word your cursor is over and enter into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ci(</code> Change all text in between a set of parenthesis.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ci"</code> If your cursor is in between a set of quotes, this will delete everything inside those quotes and drop you into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ct"</code> Change text til the quotes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>2ct"</code> Change text from cursor up til the 2nd quote in a line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>cF"</code> Change from cursor backwards finding and including the previous quote.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>C</code> Delete until the end of the line and enter into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:cd ../</code> Change directories to one previous.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:cd ~/Sites/projectname</code> Change directories to a known directory.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>CTRL-c In Normal mode, any pending command is aborted. Also aborts current search.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dd</code> Delete the current line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>D</code> Delete from cursor until the end of the line. Same as <code>d$</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dw</code> Delete the word your cursor is on. Difference between this and cw is that you do not enter into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>2dw</code> This will delete the word your cursor is on as well as the next one. You can replace 2 with any number.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>d^</code> Delete from cursor to beginning of the line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>d/pattern</code> Deletes up to first matched pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>2df"</code> Delete from cursor to find the 2nd quote mark. This is inclusive so it will delete the second quote. This is a handy command for deleting attributes in html if your cursor is on the first letter of the attribute.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>di"</code> Delete everything inside of these quotes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>da"</code> Delete everything with quotes wrapped around (including the quotes).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-d></code> Scroll half page (in this case “d” is a mnemonic for “down”).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%d</code> Deletes all lines in a file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:2,8d</code> Deletes lines two through eight.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>e</code> jumps to the end of the next word.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>E</code> jumps to the end of the next non-blank series of characters.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ge</code> jumps to the end of the previous word.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:ea 5m</code> jump to five minutes ago. Seriously.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:ea 1h</code> jump to 1 hour ago.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:ea 14h 30m</code> jump to 14 hours and 30 minutes ago. Ok you get the point.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:e filename</code> open file in the current window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:e .</code> open file explorer in current directory.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>f is for finding things so it doesn’t do anything on it’s own. It will jump to the next character you type after f. It can be combined with c,d,y to change, cut, and copy sections of text.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>fr</code> jumps to the next r on the (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ft</code> jumps to the next t on the (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>f,</code> jumps to the next , on the (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>Fr</code> jumps to the previous r (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>Ft</code> jumps to the previous t (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>F,</code> jumps to the previous , (same line only).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>2df"</code> delete from cursor through two occurences of “.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-f></code> scrolls one full page forward.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gx</code> Go to url under your cursor in a browser.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gf</code> Go open file under your cursor in the current window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>g;</code> Go to the last place you edited text.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>g,</code> Go forward in the change list.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>4g,</code> Go forward 4 spots on the change list.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gg=G</code> or <code>1G=G</code> format the entire file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gn</code> Grab the next match from last search and visually select it.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gi</code> Go into insert mode at the end of the last insert you did.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ge</code> Go to the end of the previous word.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gp</code> Pastes just like p but leave the cursor after the pasted text.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gP</code> Pastes just like P but leave the cursor after the pasted text.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gv</code> Reselects most recent visual selection.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gv$A</code> Reselects most recent visual selection then moves to the end of the line, and enters insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>g~~</code> Switch case of all characters in current line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gq</code> Format selected text.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%g/pattern/norm @q</code> Run macro q on all lines in a file that match a pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%g/^\d/norm yyGp</code> This searches for all lines of a file that start with a digit as the first character. It then copies the line and pastes it at the bottom of the file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%g/^$/norm dd</code> Delete all blank lines in a file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%g/^\$/norm "Ayy</code> Yank (copy) all lines that start with a dollar sign and append them to register A.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>h</code> Move cursor one character to the left.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>4h</code> Move cursor four characters to the left.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dh</code> Delete character to the left of cursor.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:h</code> Opens up vim help in a new window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:h a</code> Opens vim help to documentation on the a key.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:h i_CTRL-R</code> Opens vim help to documentation on pressing control and r while in insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>H</code> Move cursor to first (highest) line in window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>i</code> Enter insert mode where your cursor is. Any text you insert will be inserted before the character your cursor was over.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>4i<tab><escape></code> Insert 4 tabs (leaves you in command mode, not insert mode).</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>80i*<escape></code> Insert 80 * characters.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>I</code> Insert text at the very beginning of the line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>j</code> Moves cursor down one line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>32j</code> Moves the cursor down 32 lines.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>J</code> Joins two lines removing indent.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>k</code> moves cursor up one line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>8k</code> moves cursor up 8 lines.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-w>K</code> rotates window to horizontal split.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dk</code> delete current line and line above cursor.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>l</code> Move cursor right one character.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dl</code> Delete character under cursor. Same as x.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>L</code> Move cursor to last line in window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>m is for marking spots (which you can think of as bookmarks in your files). It does not do anything by itself.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>mk</code> mark spot as k.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>'k</code> return the cursor to the spot you marked as “k”.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>d'k</code> delete from the cursor’s position to the spot you marked as “k”.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>c'k</code> change from the cursor’s position to the spot you marked as “k”.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>y'k</code> yank/copy from the cursor’s position to the spot you marked as “k”.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>M</code> Move cursor to middle of window.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>n</code> moves forward to next match of a search pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>N</code> moves backwards to previous match of a search pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>gn</code> search forward for the last used search pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>o</code> Opens a new line below where your cursor is and places you in insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>O</code> Opens a new line above where your cursor is and places you in insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>CTRL-o</code> Go backwards in the jumplist (list of where your cursor has been). Trust me this is like movement steroids.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>12CTRL-o</code> You can also pass it a count so this will go backwards in the jumplist 12 spots.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:only</code> Closes all splits except for the current one.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>Paste is a pretty big deal when you are dealing with code. So p should be one of your best friends.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>p</code> pastes in the last thing you yanked or deleted (copied or cut) after the cursor.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>P</code> pastes in the last thing you yanked or deleted (copied or cut) before the cursor.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>2p</code> pastes in the last thing you yanked or deleted (copied or cut) twice.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>xp</code> this will swap two characters. Technically it just deletes the character under your cursor, then pastes it back in. This is the equivalent of <code>dlp</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"*p</code> Pastes in text from your system clipboard.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"2p</code> This will paste in text from the second register. You will use this all of the time. Most useful when you delete something you want to paste, then delete something else. Move to the place where you want to paste text, hit p and go “doh”. Just remember <code>"2p</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"%p</code> Pastes in the name of the current file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:212pu</code> Pastes in last copy or delete on line 212. 212 can be any line number.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:42pu *</code> Pastes in system clipboard text at line 42.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"/p</code> Pastes in your last search pattern.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:<c-r>/</code> Pastes in your last search pattern when you are on the command line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"ap</code> Pastes in the contents of register a. To see a list of registers and what they have in them, do <code>:reg</code> or <code>:registers</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>"= 8*8<CR>p</code> Pastes in evaluation of the expression <code>8*8</code>. This could be any maths you want. <code>=</code> is the expression register, which allows you to do calculations. From normal mode you can launch it by hitting <code>"=</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>q records things - so it doesn’t do much on its own. You need to tell it what register to store the recorded sequence in.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>qa</code> Begins recording into register a. Enter in keystrokes you want to save, then hit <code>q</code> to end the recording.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>@a</code> Will play back what you just recorded into register a.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:q</code> quits file only if you have no unsaved changes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:q!</code> quits file without writing any of your changes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:wq</code> saves and quits file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:12,42wq</code> saves lines 12 to 42 and quits file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:wqa</code> saves and quits all files in buffer.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>r</code> Replaces character under cursor with next input i.e.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>ra</code> Replaces the character under the cursor with a.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>R</code> Enter “replace mode” which is like insert mode except you will overwrite characters instead of insert between them.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:r filename</code> Read the contents of filename and place into the current buffer.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:r !ls</code> Pastes in the output of ls. ! calls an external process in vim. So this can be pretty userful.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:r !cd -; ls</code> Pastes in the directory listing of the last directory you were in.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:r !w3m -dump http://somewebsite.com</code> Pastes in the content from somewebsite.com without any of the markup. Must have w3m installed. WHICH YOU SHOULD :) If you have homebrew installed you can simply run <code>brew install w3m</code>.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:r !tree</code> Pastes in the output from running tree on a directory.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:reg</code> or <code>:registers</code> Print out a list of available registers and their contents. Registers are like a multi-shelf clipboard. But it also stores all of your recent deletes. In vim delete behaves more like cut than a true delete.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>s</code> deletes the character your cursor is on and enters into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>S</code> deletes the whole line you are on and enters into insert mode.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:sp</code> This will split the current window horizontally. Sp is short for split.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:sp file.txt</code> This will split the current window horizontally with a file named file.txt.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:vsp file.txt</code> This will split the current window vertically. vsp stands for vertical split.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p>s is how you do find and replace, so let’s just say it is all of the important.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:s/foo/bar</code> replaces foo with bar on the current line for the first occurance of foo.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:12,42s/foo/bar</code> replaces foo with bar on lines 12,42 for the first occurance of foo in each line.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:12,42s/foo/bar/g</code> replaces all occurances of foo with bar on lines 12,42.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%s/foo/bar/g</code> replaces all occurances of foo with bar for the entire file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:'<,'>s/foo/bar/g</code> replaces all occurances of foo with bar for the last visual selection.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%~</code> Repeat last substitute with same substitute string but with last used search pattern across the entire file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%s/\ class=".*"//g"</code> Delete all classes in markup for the current file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%s/\ id=".*"//g"</code> Delete all ids in markup for the current file.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:bufdo %s/\ class=".*"//ge | update</code> Delete all classes in markup for all files in buffer.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:tabdo %s/\ class=".*"//ge | update</code> Delete all classes in markup for all files in the current tab.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>:%s/\s\+$//e</code> Removes trailing whitespace.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>t</code> means ‘til’ so it doesn’t do anything on its own. It is very similar to f but f is inclusive. T is exclusive meaning it will stop before the character you are finding.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>tf</code> put cursor one character before the next occurance of f.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>;</code> repeat latest f, F, t, or T.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>,</code> repeat it in the opposite direction.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dt<</code> Delete up until the next <code><</code>. This is handy in the markup world.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dt"</code> Delete from cursor until next “.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>dT}</code> Delete backwards from cursor until previous }.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>u</code> Undo changes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code>U</code> Undo all latest changes on one line, the line where the latest change was made.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-r></code> Redo changes.</p>
</blockquote>
</div>
<div class="cbp-qtcontent">
<blockquote>
<p><code><C-u></code> Scroll window upwards to the amount set by the “scroll” option. Default is half a screen.</p>
</blockquote>
</div>