-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathHelix.rb
More file actions
1541 lines (1505 loc) · 33.4 KB
/
Copy pathHelix.rb
File metadata and controls
1541 lines (1505 loc) · 33.4 KB
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
cheatsheet do
title 'Helix'
docset_file_name 'Helix'
keyword 'helix'
source_url 'http://cheat.kapeli.com'
category do
id 'Movement'
entry do
command 'h'
command 'Left'
name 'Move left'
end
entry do
command 'j'
command 'Down'
name 'Move down'
end
entry do
command 'k'
command 'Up'
name 'Move up'
end
entry do
command 'l'
command 'Right'
name 'Move right'
end
entry do
command 'w'
name 'Move next word start'
end
entry do
command 'b'
name 'Move previous word start'
end
entry do
command 'W'
name 'Move next WORD start'
end
entry do
command 'B'
name 'Move previous WORD start'
end
entry do
command 'E'
name 'Move next WORD end'
end
entry do
command 't'
name 'Find \'till next char'
end
entry do
command 'f'
name 'Find next char'
end
entry do
command 'T'
name 'Find \'till previous char'
end
entry do
command 'F'
name 'Find previous char'
end
entry do
command 'G'
name 'Go to line number `<n>`'
end
entry do
command 'G'
name 'Go to line number `<n>`'
end
entry do
command 'Alt-.'
name 'Repeat last motion (f, t or m)'
end
entry do
command 'Home'
name 'Move to the start of the line'
end
entry do
command 'End'
name 'Move to the end of the line'
end
entry do
command 'Ctrl-b'
command 'PageUp'
name 'Move page up'
end
entry do
command 'Ctrl-f'
command 'PageDown'
name 'Move page down'
end
entry do
command 'Ctrl-u'
name 'Move half page up'
end
entry do
command 'Ctrl-d'
name 'Move half page down'
end
entry do
command 'Ctrl-i'
name 'Jump forward on the jumplist'
end
entry do
command 'Ctrl-o'
name 'Jump backward on the jumplist'
end
entry do
command 'Ctrl-s'
name 'Save the current selection to the jumplist'
end
end
category do
id 'Changes'
entry do
command 'r'
name 'Replace with a character'
end
entry do
command 'R'
name 'Replace with yanked text'
end
entry do
command '~'
name 'Switch case of the selected text'
end
entry do
command '`'
name 'Set the selected text to lower case'
end
entry do
command 'Alt-`'
name 'Set the selected text to upper case'
end
entry do
command 'i'
name 'Insert before selection'
end
entry do
command 'a'
name 'Insert after selection (append)'
end
entry do
command 'I'
name 'Insert at the start of the line'
end
entry do
command 'A'
name 'Insert at the end of the line'
end
entry do
command 'o'
name 'Open new line below selection'
end
entry do
command 'O'
name 'Open new line above selection'
end
entry do
command '.'
name 'Repeat last insert'
end
entry do
command 'u'
name 'Undo change'
end
entry do
command 'U'
name 'Redo change'
end
entry do
command 'Alt-u'
name 'Move backward in history'
end
entry do
command 'Alt-U'
name 'Move forward in history'
end
entry do
command 'y'
name 'Yank selection'
end
entry do
command 'p'
name 'Paste after selection'
end
entry do
command 'P'
name 'Paste before selection'
end
entry do
command '" <reg>'
name 'Select a register to yank to or paste from'
end
entry do
command '>'
name 'Indent selection'
end
entry do
command '<'
name 'Unindent selection'
end
entry do
command '='
name 'Format selection (currently nonfunctional/disabled) (LSP)'
end
entry do
command 'd'
name 'Delete selection'
end
entry do
command 'Alt-d'
name 'Delete selection, without yanking'
end
entry do
command 'c'
name 'Change selection (delete and enter insert mode)'
end
entry do
command 'Alt-c'
name 'Change selection (delete and enter insert mode, without yanking)'
end
entry do
command 'Ctrl-a'
name 'Increment object (number) under cursor'
end
entry do
command 'Ctrl-x'
name 'Decrement object (number) under cursor'
end
entry do
command 'Q'
name 'Start/stop macro recording to the selected register (experimental)'
end
entry do
command 'q'
name 'Play back a recorded macro from the selected register (experimental)'
end
end
category do
id 'Shell'
entry do
command '|'
name 'Pipe each selection through shell command, replacing with output'
end
entry do
command 'Alt-|'
name 'Pipe each selection into shell command, ignoring output'
end
entry do
command '!'
name 'Run shell command, inserting output before each selection'
end
entry do
command 'Alt-!'
name 'Run shell command, appending output after each selection'
end
entry do
command '$'
name 'Pipe each selection into shell command, keep selections where command returned 0'
end
end
category do
id 'Selection manipulation'
entry do
command 's'
name 'Select all regex matches inside selections'
end
entry do
command 'S'
name 'Split selection into sub selections on regex matches'
end
entry do
command 'Alt-s'
name 'Split selection on newlines'
end
entry do
command 'Alt-_'
name 'Merge consecutive selections'
end
entry do
command '&'
name 'Align selection in columns'
end
entry do
command '_'
name 'Trim whitespace from the selection'
end
entry do
command ';'
name 'Collapse selection onto a single cursor'
end
entry do
command 'Alt-;'
name 'Flip selection cursor and anchor'
end
entry do
command 'Alt-:'
name 'Ensures the selection is in forward direction'
end
entry do
command ','
name 'Keep only the primary selection'
end
entry do
command 'Alt-,'
name 'Remove the primary selection'
end
entry do
command 'C'
name 'Copy selection onto the next line (Add cursor below)'
end
entry do
command 'Alt-C'
name 'Copy selection onto the previous line (Add cursor above)'
end
entry do
command '('
name 'Rotate main selection backward'
end
entry do
command ')'
name 'Rotate main selection forward'
end
entry do
command 'Alt-('
name 'Rotate selection contents backward'
end
entry do
command 'Alt-)'
name 'Rotate selection contents forward'
end
entry do
command '%'
name 'Select entire file'
end
entry do
command 'x'
name 'Select current line, if already selected, extend to next line'
end
entry do
command 'X'
name 'Extend selection to line bounds (line-wise selection)'
end
entry do
command 'Alt-x'
name 'Shrink selection to line bounds (line-wise selection)'
end
entry do
command 'J'
name 'Join lines inside selection'
end
entry do
command 'Alt-J'
name 'Join lines inside selection and select the inserted space'
end
entry do
command 'K'
name 'Keep selections matching the regex'
end
entry do
command 'Alt-K'
name 'Remove selections matching the regex'
end
entry do
command 'Ctrl-c'
name 'Comment/uncomment the selections'
end
entry do
command 'Alt-o'
command 'Alt-up'
name 'Expand selection to parent syntax node (TS)'
end
entry do
command 'Alt-i'
command 'Alt-down'
name 'Shrink syntax tree object selection (TS)'
end
entry do
command 'Alt-p'
command 'Alt-left'
name 'Select previous sibling node in syntax tree (TS)'
end
entry do
command 'Alt-n'
command 'Alt-right'
name 'Select next sibling node in syntax tree (TS)'
end
end
category do
id 'Search'
entry do
command '/'
name 'Search for regex pattern'
end
entry do
command '?'
name 'Search for previous pattern'
end
entry do
command 'n'
name 'Select next search match'
end
entry do
command 'N'
name 'Select previous search match'
end
entry do
command '*'
name 'Use current selection as the search pattern'
end
end
category do
id 'Minor modes'
entry do
command 'v'
name 'Enter select (extend) mode'
end
entry do
command 'g'
name 'Enter goto mode'
end
entry do
command 'm'
name 'Enter match mode'
end
entry do
command ':'
name 'Enter command mode'
end
entry do
command 'z'
name 'Enter view mode'
end
entry do
command 'Z'
name 'Enter sticky view mode'
end
entry do
command 'Ctrl-w'
name 'Enter window mode'
end
entry do
command 'Space'
name 'Enter space mode'
end
end
category do
id 'View Mode'
entry do
command 'z'
command 'c'
name 'Vertically center the line'
end
entry do
command 't'
name 'Align the line to the top of the screen'
end
entry do
command 'b'
name 'Align the line to the bottom of the screen'
end
entry do
command 'm'
name 'Align the line to the middle of the screen (horizontally)'
end
entry do
command 'j'
command 'down'
name 'Scroll the view downwards'
end
entry do
command 'k'
command 'up'
name 'Scroll the view upwards'
end
entry do
command 'Ctrl-f'
command 'PageDown'
name 'Move page down'
end
entry do
command 'Ctrl-b'
command 'PageUp'
name 'Move page up'
end
entry do
command 'Ctrl-d'
name 'Move half page down'
end
entry do
command 'Ctrl-u'
name 'Move half page up'
end
end
category do
id 'Goto mode'
entry do
command 'g'
name 'Go to line number <n> else start of file'
end
entry do
command 'e'
name 'Go to the end of the file'
end
entry do
command 'f'
name 'Go to files in the selection'
end
entry do
command 'h'
name 'Go to the start of the line'
end
entry do
command 'l'
name 'Go to the end of the line'
end
entry do
command 's'
name 'Go to first non-whitespace character of the line'
end
entry do
command 't'
name 'Go to the top of the screen'
end
entry do
command 'c'
name 'Go to the middle of the screen'
end
entry do
command 'b'
name 'Go to the bottom of the screen'
end
entry do
command 'd'
name 'Go to definition (LSP)'
end
entry do
command 'y'
name 'Go to type definition (LSP)'
end
entry do
command 'r'
name 'Go to references (LSP)'
end
entry do
command 'i'
name 'Go to implementation (LSP)'
end
entry do
command 'a'
name 'Go to the last accessed/alternate file'
end
entry do
command 'm'
name 'Go to the last modified/alternate file'
end
entry do
command 'n'
name 'Go to next buffer'
end
entry do
command 'p'
name 'Go to previous buffer'
end
entry do
command '.'
name 'Go to last modification in current file'
end
entry do
command 'j'
name 'Move down textual (instead of visual) line'
end
entry do
command 'k'
name 'Move up textual (instead of visual) line'
end
end
category do
id 'Match mode'
entry do
command 'm'
name 'Goto matching bracket (TS)'
end
entry do
command 's <char>'
name 'Surround current selection with <char>'
end
entry do
command 'r <from><to>'
name 'Replace surround character <from> with <to>'
end
entry do
command 'd <char>'
name 'Delete surround character <char>'
end
entry do
command 'a <object>'
name 'Select around textobject'
end
entry do
command 'i <object>'
name 'Select inside textobject'
end
end
category do
id 'Window mode'
entry do
command 'w'
command 'Ctrl-w'
name 'Switch to next window'
end
entry do
command 'v'
command 'Ctrl-v'
name 'Vertical right split'
end
entry do
command 's'
command 'Ctrl-s'
name 'Horizontal bottom split'
end
entry do
command 'f'
name 'Go to files in the selection in horizontal splits'
end
entry do
command 'F'
name 'Go to files in the selection in vertical splits'
end
entry do
command 'h'
command 'Ctrl-h'
command 'Left'
name 'Move to left split'
end
entry do
command 'j'
command 'Ctrl-j'
command 'Down'
name 'Move to split below'
end
entry do
command 'k'
command 'Ctrl-k'
command 'Up'
name 'Move to split above'
end
entry do
command 'l'
command 'Ctrl-l'
command 'Right'
name 'Move to right split'
end
entry do
command 'q'
command 'Ctrl-q'
name 'Close current window'
end
entry do
command 'o'
command 'Ctrl-o'
name 'Only keep the current window, closing all the others'
end
entry do
command 'H'
name 'Swap window to the left'
end
entry do
command 'J'
name 'Swap window downwards'
end
entry do
command 'K'
name 'Swap window upwards'
end
entry do
command 'L'
name 'Swap window to the right'
end
end
category do
id 'Space mode'
entry do
command 'f'
name 'Open file picker'
end
entry do
command 'F'
name 'Open file picker at current working directory'
end
entry do
command 'b'
name 'Open buffer picker'
end
entry do
command 'j'
name 'Open jumplist picker'
end
entry do
command 'g'
name 'Debug (experimental)'
end
entry do
command 'k'
name 'Show documentation for item under cursor in a popup (LSP)'
end
entry do
command 's'
name 'Open document symbol picker (LSP)'
end
entry do
command 'S'
name 'Open workspace symbol picker (LSP)'
end
entry do
command 'd'
name 'Open document diagnostics picker (LSP)'
end
entry do
command 'D'
name 'Open workspace diagnostics picker (LSP)'
end
entry do
command 'r'
name 'Rename symbol (LSP)'
end
entry do
command 'a'
name 'Apply code action (LSP)'
end
entry do
command 'h'
name 'Select symbol references (LSP)'
end
entry do
command '\''
name 'Open last fuzzy picker'
end
entry do
command 'w'
name 'Enter window mode'
end
entry do
command 'p'
name 'Paste system clipboard after selections'
end
entry do
command 'P'
name 'Paste system clipboard before selections'
end
entry do
command 'y'
name 'Join and yank selections to clipboard'
end
entry do
command 'Y'
name 'Yank main selection to clipboard'
end
entry do
command 'R'
name 'Replace selections by clipboard contents'
end
entry do
command '/'
name 'Global search in workspace folder'
end
entry do
command '?'
name 'Open command palette'
end
end
category do
id 'Popup'
entry do
command 'Ctrl-u'
name 'Scroll up'
end
entry do
command 'Ctrl-d'
name 'Scroll down'
end
end
category do
id 'Unimpaired'
entry do
command ']d'
name 'Go to next diagnostic (LSP)'
end
entry do
command '[d'
name 'Go to previous diagnostic (LSP)'
end
entry do
command ']D'
name 'Go to last diagnostic in document (LSP)'
end
entry do
command '[D'
name 'Go to first diagnostic in document (LSP)'
end
entry do
command ']f'
name 'Go to next function (TS)'
end
entry do
command '[f'
name 'Go to previous function (TS)'
end
entry do
command ']t'
name 'Go to next type definition (TS)'
end
entry do
command '[t'
name 'Go to previous type definition (TS)'
end
entry do
command ']a'
name 'Go to next argument/parameter (TS)'
end
entry do
command '[a'
name 'Go to previous argument/parameter (TS)'
end
entry do
command ']c'
name 'Go to next comment (TS)'
end
entry do
command '[c'
name 'Go to previous comment (TS)'
end
entry do
command ']T'
name 'Go to next test (TS)'
end
entry do
command '[T'
name 'Go to previous test (TS)'
end
entry do
command ']p'
name 'Go to next paragraph'
end
entry do
command '[p'
name 'Go to previous paragraph'
end
entry do
command ']g'
name 'Go to next change'
end
entry do
command '[g'
name 'Go to previous change'
end
entry do
command ']G'
name 'Go to last change'
end
entry do
command '[G'
name 'Go to first change'
end
entry do
command ']Space'
name 'Add newline below'
end
entry do
command '[Space'
name 'Add newline above'
end
end
category do
id 'Insert mode'
entry do
command 'Escape'
name 'Switch to normal mode'
end
entry do
command 'Ctrl-s'
name 'Commit undo checkpoint'
end
entry do
command 'Ctrl-x'
name 'Autocomplete'
end
entry do
command 'Ctrl-r'
name 'Insert a register content'
end
entry do
command 'Ctrl-w'
command 'Alt-Backspace'
name 'Delete previous word'
end
entry do
command 'Alt-d'
command 'Alt-Delete'
name 'Delete next word'
end
entry do
command 'Ctrl-u'
name 'Delete to start of line'
end
entry do
command 'Ctrl-k'
name 'Delete to end of line'
end
entry do
command 'Ctrl-h'
command 'Backspace'
command 'Shift-Backspace'
name 'Delete previous char'
end
entry do
command 'Ctrl-d'
command 'Delete'
name 'Delete next char'
end
entry do
command 'Ctrl-j'
command 'Enter'
name 'Insert new line'
end
entry do
command 'Up'
name 'Move to previous line'
end
entry do
command 'Down'
name 'Move to next line'
end
entry do
command 'Left'
name 'Backward a char'
end
entry do
command 'Right'
name 'Forward a char'
end
entry do
command 'PageUp'
name 'Move one page up'
end
entry do
command 'PageDown'
name 'Move one page down'
end
entry do
command 'Home'
name 'Move to line start'
end
entry do
command 'End'
name 'Move to line end'
end
end
category do
id 'Picker'
entry do
command 'Shift-Tab'
command 'Up'
command 'Ctrl-p'
name 'Previous entry'
end
entry do