forked from martanne/vis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
2464 lines (2329 loc) · 74.3 KB
/
main.c
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
#include <signal.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <wchar.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "ui-terminal.h"
#include "vis.h"
#include "vis-lua.h"
#include "text-util.h"
#include "text-motions.h"
#include "text-objects.h"
#include "util.h"
#include "libutf.h"
#include "array.h"
#include "buffer.h"
#define PAGE INT_MAX
#define PAGE_HALF (INT_MAX-1)
/** functions to be called from keybindings */
/* ignore key, do nothing */
static const char *nop(Vis*, const char *keys, const Arg *arg);
/* record/replay macro indicated by keys */
static const char *macro_record(Vis*, const char *keys, const Arg *arg);
static const char *macro_replay(Vis*, const char *keys, const Arg *arg);
/* temporarily suspend the editor and return to the shell, type 'fg' to get back */
static const char *suspend(Vis*, const char *keys, const Arg *arg);
/* switch to mode indicated by arg->i */
static const char *switchmode(Vis*, const char *keys, const Arg *arg);
/* switch to insert mode after performing movement indicated by arg->i */
static const char *insertmode(Vis*, const char *keys, const Arg *arg);
/* switch to replace mode after performing movement indicated by arg->i */
static const char *replacemode(Vis*, const char *keys, const Arg *arg);
/* add a new line either before or after the one where the cursor currently is */
static const char *openline(Vis*, const char *keys, const Arg *arg);
/* join lines from current cursor position to movement indicated by arg */
static const char *join(Vis*, const char *keys, const Arg *arg);
/* perform last action i.e. action_prev again */
static const char *repeat(Vis*, const char *keys, const Arg *arg);
/* replace character at cursor with one from keys */
static const char *replace(Vis*, const char *keys, const Arg *arg);
/* create a new cursor on the previous (arg->i < 0) or next (arg->i > 0) line */
static const char *selections_new(Vis*, const char *keys, const Arg *arg);
/* try to align all selections on the same column */
static const char *selections_align(Vis*, const char *keys, const Arg *arg);
/* try to align all selections by inserting the correct amount of white spaces */
static const char *selections_align_indent(Vis*, const char *keys, const Arg *arg);
/* remove all but the primary cursor and their selections */
static const char *selections_clear(Vis*, const char *keys, const Arg *arg);
/* remove the least recently added selection */
static const char *selections_remove(Vis*, const char *keys, const Arg *arg);
/* remove count (or arg->i)-th selection column */
static const char *selections_remove_column(Vis*, const char *keys, const Arg *arg);
/* remove all but the count (or arg->i)-th selection column */
static const char *selections_remove_column_except(Vis*, const char *keys, const Arg *arg);
/* move to the previous (arg->i < 0) or next (arg->i > 0) selection */
static const char *selections_navigate(Vis*, const char *keys, const Arg *arg);
/* select the word the selection is currently over */
static const char *selections_match_word(Vis*, const char *keys, const Arg *arg);
/* select the next region matching the current selection */
static const char *selections_match_next(Vis*, const char *keys, const Arg *arg);
/* clear current selection but select next match */
static const char *selections_match_skip(Vis*, const char *keys, const Arg *arg);
/* rotate selection content count times left (arg->i < 0) or right (arg->i > 0) */
static const char *selections_rotate(Vis*, const char *keys, const Arg *arg);
/* remove leading and trailing white spaces from selections */
static const char *selections_trim(Vis*, const char *keys, const Arg *arg);
/* save active selections to register */
static const char *selections_save(Vis*, const char *keys, const Arg *arg);
/* restore selections from register */
static const char *selections_restore(Vis*, const char *keys, const Arg *arg);
/* union selections */
static const char *selections_union(Vis*, const char *keys, const Arg *arg);
/* intersect selections */
static const char *selections_intersect(Vis*, const char *keys, const Arg *arg);
/* perform complement of current active selections */
static const char *selections_complement(Vis*, const char *keys, const Arg *arg);
/* subtract selections from register */
static const char *selections_minus(Vis*, const char *keys, const Arg *arg);
/* pairwise combine selections */
static const char *selections_combine(Vis*, const char *keys, const Arg *arg);
static Filerange combine_union(const Filerange*, const Filerange*);
static Filerange combine_intersect(const Filerange*, const Filerange*);
static Filerange combine_longer(const Filerange*, const Filerange*);
static Filerange combine_shorter(const Filerange*, const Filerange*);
static Filerange combine_leftmost(const Filerange*, const Filerange*);
static Filerange combine_rightmost(const Filerange*, const Filerange*);
/* adjust current used count according to keys */
static const char *count(Vis*, const char *keys, const Arg *arg);
/* move to the count-th line or if not given either to the first (arg->i < 0)
* or last (arg->i > 0) line of file */
static const char *gotoline(Vis*, const char *keys, const Arg *arg);
/* set motion type either LINEWISE or CHARWISE via arg->i */
static const char *motiontype(Vis*, const char *keys, const Arg *arg);
/* make the current action use the operator indicated by arg->i */
static const char *operator(Vis*, const char *keys, const Arg *arg);
/* blocks to read a key and performs movement indicated by arg->i which
* should be one of VIS_MOVE_{RIGHT,LEFT}_{TO,TILL} */
static const char *movement_key(Vis*, const char *keys, const Arg *arg);
/* perform the movement as indicated by arg->i */
static const char *movement(Vis*, const char *keys, const Arg *arg);
/* let the current operator affect the range indicated by the text object arg->i */
static const char *textobj(Vis*, const char *keys, const Arg *arg);
/* move to the other end of selected text */
static const char *selection_end(Vis*, const char *keys, const Arg *arg);
/* use register indicated by keys for the current operator */
static const char *reg(Vis*, const char *keys, const Arg *arg);
/* use mark indicated by keys for the current action */
static const char *mark(Vis*, const char *keys, const Arg *arg);
/* {un,re}do last action, redraw window */
static const char *undo(Vis*, const char *keys, const Arg *arg);
static const char *redo(Vis*, const char *keys, const Arg *arg);
/* earlier, later action chronologically, redraw window */
static const char *earlier(Vis*, const char *keys, const Arg *arg);
static const char *later(Vis*, const char *keys, const Arg *arg);
/* delete from the current cursor position to the end of
* movement as indicated by arg->i */
static const char *delete(Vis*, const char *keys, const Arg *arg);
/* insert register content indicated by keys at current cursor position */
static const char *insert_register(Vis*, const char *keys, const Arg *arg);
/* show a user prompt to get input with title arg->s */
static const char *prompt_show(Vis*, const char *keys, const Arg *arg);
/* blocks to read 3 consecutive digits and inserts the corresponding byte value */
static const char *insert_verbatim(Vis*, const char *keys, const Arg *arg);
/* scroll window content according to arg->i which can be either PAGE, PAGE_HALF,
* or an arbitrary number of lines. a multiplier overrides what is given in arg->i.
* negative values scroll back, positive forward. */
static const char *wscroll(Vis*, const char *keys, const Arg *arg);
/* similar to scroll, but do only move window content not cursor position */
static const char *wslide(Vis*, const char *keys, const Arg *arg);
/* call editor function as indicated by arg->f */
static const char *call(Vis*, const char *keys, const Arg *arg);
/* call window function as indicated by arg->w */
static const char *window(Vis*, const char *keys, const Arg *arg);
/* show info about Unicode character at cursor position */
static const char *unicode_info(Vis*, const char *keys, const Arg *arg);
/* either go to count % of file or to matching item */
static const char *percent(Vis*, const char *keys, const Arg *arg);
/* navigate jumplist next (arg->i > 0), prev (arg->i < 0), save (arg->i = 0) */
static const char *jumplist(Vis*, const char *keys, const Arg *arg);
enum {
VIS_ACTION_EDITOR_SUSPEND,
VIS_ACTION_CURSOR_CHAR_PREV,
VIS_ACTION_CURSOR_CHAR_NEXT,
VIS_ACTION_CURSOR_LINE_CHAR_PREV,
VIS_ACTION_CURSOR_LINE_CHAR_NEXT,
VIS_ACTION_CURSOR_CODEPOINT_PREV,
VIS_ACTION_CURSOR_CODEPOINT_NEXT,
VIS_ACTION_CURSOR_WORD_START_PREV,
VIS_ACTION_CURSOR_WORD_START_NEXT,
VIS_ACTION_CURSOR_WORD_END_PREV,
VIS_ACTION_CURSOR_WORD_END_NEXT,
VIS_ACTION_CURSOR_LONGWORD_START_PREV,
VIS_ACTION_CURSOR_LONGWORD_START_NEXT,
VIS_ACTION_CURSOR_LONGWORD_END_PREV,
VIS_ACTION_CURSOR_LONGWORD_END_NEXT,
VIS_ACTION_CURSOR_LINE_UP,
VIS_ACTION_CURSOR_LINE_DOWN,
VIS_ACTION_CURSOR_LINE_START,
VIS_ACTION_CURSOR_LINE_FINISH,
VIS_ACTION_CURSOR_LINE_BEGIN,
VIS_ACTION_CURSOR_LINE_END,
VIS_ACTION_CURSOR_SCREEN_LINE_UP,
VIS_ACTION_CURSOR_SCREEN_LINE_DOWN,
VIS_ACTION_CURSOR_SCREEN_LINE_BEGIN,
VIS_ACTION_CURSOR_SCREEN_LINE_MIDDLE,
VIS_ACTION_CURSOR_SCREEN_LINE_END,
VIS_ACTION_CURSOR_PERCENT,
VIS_ACTION_CURSOR_BYTE,
VIS_ACTION_CURSOR_BYTE_LEFT,
VIS_ACTION_CURSOR_BYTE_RIGHT,
VIS_ACTION_CURSOR_PARAGRAPH_PREV,
VIS_ACTION_CURSOR_PARAGRAPH_NEXT,
VIS_ACTION_CURSOR_SENTENCE_PREV,
VIS_ACTION_CURSOR_SENTENCE_NEXT,
VIS_ACTION_CURSOR_BLOCK_START,
VIS_ACTION_CURSOR_BLOCK_END,
VIS_ACTION_CURSOR_PARENTHESE_START,
VIS_ACTION_CURSOR_PARENTHESE_END,
VIS_ACTION_CURSOR_COLUMN,
VIS_ACTION_CURSOR_LINE_FIRST,
VIS_ACTION_CURSOR_LINE_LAST,
VIS_ACTION_CURSOR_WINDOW_LINE_TOP,
VIS_ACTION_CURSOR_WINDOW_LINE_MIDDLE,
VIS_ACTION_CURSOR_WINDOW_LINE_BOTTOM,
VIS_ACTION_CURSOR_SEARCH_REPEAT_FORWARD,
VIS_ACTION_CURSOR_SEARCH_REPEAT_BACKWARD,
VIS_ACTION_CURSOR_SEARCH_REPEAT,
VIS_ACTION_CURSOR_SEARCH_REPEAT_REVERSE,
VIS_ACTION_CURSOR_SEARCH_WORD_FORWARD,
VIS_ACTION_CURSOR_SEARCH_WORD_BACKWARD,
VIS_ACTION_WINDOW_PAGE_UP,
VIS_ACTION_WINDOW_PAGE_DOWN,
VIS_ACTION_WINDOW_HALFPAGE_UP,
VIS_ACTION_WINDOW_HALFPAGE_DOWN,
VIS_ACTION_MODE_NORMAL,
VIS_ACTION_MODE_VISUAL,
VIS_ACTION_MODE_VISUAL_LINE,
VIS_ACTION_MODE_INSERT,
VIS_ACTION_MODE_REPLACE,
VIS_ACTION_DELETE_CHAR_PREV,
VIS_ACTION_DELETE_CHAR_NEXT,
VIS_ACTION_DELETE_LINE_BEGIN,
VIS_ACTION_DELETE_WORD_PREV,
VIS_ACTION_JUMPLIST_PREV,
VIS_ACTION_JUMPLIST_NEXT,
VIS_ACTION_JUMPLIST_SAVE,
VIS_ACTION_UNDO,
VIS_ACTION_REDO,
VIS_ACTION_EARLIER,
VIS_ACTION_LATER,
VIS_ACTION_MACRO_RECORD,
VIS_ACTION_MACRO_REPLAY,
VIS_ACTION_MARK,
VIS_ACTION_REDRAW,
VIS_ACTION_REPLACE_CHAR,
VIS_ACTION_TOTILL_REPEAT,
VIS_ACTION_TOTILL_REVERSE,
VIS_ACTION_PROMPT_SEARCH_FORWARD,
VIS_ACTION_PROMPT_SEARCH_BACKWARD,
VIS_ACTION_TILL_LEFT,
VIS_ACTION_TILL_RIGHT,
VIS_ACTION_TO_LEFT,
VIS_ACTION_TO_RIGHT,
VIS_ACTION_REGISTER,
VIS_ACTION_OPERATOR_CHANGE,
VIS_ACTION_OPERATOR_DELETE,
VIS_ACTION_OPERATOR_YANK,
VIS_ACTION_OPERATOR_SHIFT_LEFT,
VIS_ACTION_OPERATOR_SHIFT_RIGHT,
VIS_ACTION_OPERATOR_CASE_LOWER,
VIS_ACTION_OPERATOR_CASE_UPPER,
VIS_ACTION_OPERATOR_CASE_SWAP,
VIS_ACTION_COUNT,
VIS_ACTION_INSERT_NEWLINE,
VIS_ACTION_INSERT_TAB,
VIS_ACTION_INSERT_VERBATIM,
VIS_ACTION_INSERT_REGISTER,
VIS_ACTION_WINDOW_NEXT,
VIS_ACTION_WINDOW_PREV,
VIS_ACTION_APPEND_CHAR_NEXT,
VIS_ACTION_APPEND_LINE_END,
VIS_ACTION_INSERT_LINE_START,
VIS_ACTION_OPEN_LINE_ABOVE,
VIS_ACTION_OPEN_LINE_BELOW,
VIS_ACTION_JOIN_LINES,
VIS_ACTION_JOIN_LINES_TRIM,
VIS_ACTION_PROMPT_SHOW,
VIS_ACTION_REPEAT,
VIS_ACTION_SELECTION_FLIP,
VIS_ACTION_WINDOW_REDRAW_TOP,
VIS_ACTION_WINDOW_REDRAW_CENTER,
VIS_ACTION_WINDOW_REDRAW_BOTTOM,
VIS_ACTION_WINDOW_SLIDE_UP,
VIS_ACTION_WINDOW_SLIDE_DOWN,
VIS_ACTION_PUT_AFTER,
VIS_ACTION_PUT_BEFORE,
VIS_ACTION_PUT_AFTER_END,
VIS_ACTION_PUT_BEFORE_END,
VIS_ACTION_SELECTIONS_MATCH_WORD,
VIS_ACTION_SELECTIONS_NEW_LINE_ABOVE,
VIS_ACTION_SELECTIONS_NEW_LINE_ABOVE_FIRST,
VIS_ACTION_SELECTIONS_NEW_LINE_BELOW,
VIS_ACTION_SELECTIONS_NEW_LINE_BELOW_LAST,
VIS_ACTION_SELECTIONS_NEW_LINES_BEGIN,
VIS_ACTION_SELECTIONS_NEW_LINES_END,
VIS_ACTION_SELECTIONS_NEW_MATCH_NEXT,
VIS_ACTION_SELECTIONS_NEW_MATCH_SKIP,
VIS_ACTION_SELECTIONS_ALIGN,
VIS_ACTION_SELECTIONS_ALIGN_INDENT_LEFT,
VIS_ACTION_SELECTIONS_ALIGN_INDENT_RIGHT,
VIS_ACTION_SELECTIONS_REMOVE_ALL,
VIS_ACTION_SELECTIONS_REMOVE_LAST,
VIS_ACTION_SELECTIONS_REMOVE_COLUMN,
VIS_ACTION_SELECTIONS_REMOVE_COLUMN_EXCEPT,
VIS_ACTION_SELECTIONS_PREV,
VIS_ACTION_SELECTIONS_NEXT,
VIS_ACTION_SELECTIONS_ROTATE_LEFT,
VIS_ACTION_SELECTIONS_ROTATE_RIGHT,
VIS_ACTION_SELECTIONS_TRIM,
VIS_ACTION_SELECTIONS_SAVE,
VIS_ACTION_SELECTIONS_RESTORE,
VIS_ACTION_SELECTIONS_UNION,
VIS_ACTION_SELECTIONS_INTERSECT,
VIS_ACTION_SELECTIONS_COMPLEMENT,
VIS_ACTION_SELECTIONS_MINUS,
VIS_ACTION_SELECTIONS_COMBINE_UNION,
VIS_ACTION_SELECTIONS_COMBINE_INTERSECT,
VIS_ACTION_SELECTIONS_COMBINE_LONGER,
VIS_ACTION_SELECTIONS_COMBINE_SHORTER,
VIS_ACTION_SELECTIONS_COMBINE_LEFTMOST,
VIS_ACTION_SELECTIONS_COMBINE_RIGHTMOST,
VIS_ACTION_TEXT_OBJECT_WORD_OUTER,
VIS_ACTION_TEXT_OBJECT_WORD_INNER,
VIS_ACTION_TEXT_OBJECT_LONGWORD_OUTER,
VIS_ACTION_TEXT_OBJECT_LONGWORD_INNER,
VIS_ACTION_TEXT_OBJECT_SENTENCE,
VIS_ACTION_TEXT_OBJECT_PARAGRAPH,
VIS_ACTION_TEXT_OBJECT_PARAGRAPH_OUTER,
VIS_ACTION_TEXT_OBJECT_SQUARE_BRACKET_OUTER,
VIS_ACTION_TEXT_OBJECT_SQUARE_BRACKET_INNER,
VIS_ACTION_TEXT_OBJECT_PARENTHESIS_OUTER,
VIS_ACTION_TEXT_OBJECT_PARENTHESIS_INNER,
VIS_ACTION_TEXT_OBJECT_ANGLE_BRACKET_OUTER,
VIS_ACTION_TEXT_OBJECT_ANGLE_BRACKET_INNER,
VIS_ACTION_TEXT_OBJECT_CURLY_BRACKET_OUTER,
VIS_ACTION_TEXT_OBJECT_CURLY_BRACKET_INNER,
VIS_ACTION_TEXT_OBJECT_QUOTE_OUTER,
VIS_ACTION_TEXT_OBJECT_QUOTE_INNER,
VIS_ACTION_TEXT_OBJECT_SINGLE_QUOTE_OUTER,
VIS_ACTION_TEXT_OBJECT_SINGLE_QUOTE_INNER,
VIS_ACTION_TEXT_OBJECT_BACKTICK_OUTER,
VIS_ACTION_TEXT_OBJECT_BACKTICK_INNER,
VIS_ACTION_TEXT_OBJECT_ENTIRE_OUTER,
VIS_ACTION_TEXT_OBJECT_ENTIRE_INNER,
VIS_ACTION_TEXT_OBJECT_LINE_OUTER,
VIS_ACTION_TEXT_OBJECT_LINE_INNER,
VIS_ACTION_TEXT_OBJECT_INDENTATION,
VIS_ACTION_TEXT_OBJECT_SEARCH_FORWARD,
VIS_ACTION_TEXT_OBJECT_SEARCH_BACKWARD,
VIS_ACTION_MOTION_CHARWISE,
VIS_ACTION_MOTION_LINEWISE,
VIS_ACTION_UNICODE_INFO,
VIS_ACTION_UTF8_INFO,
VIS_ACTION_NOP,
};
static const KeyAction vis_action[] = {
[VIS_ACTION_EDITOR_SUSPEND] = {
"vis-suspend",
VIS_HELP("Suspend the editor")
suspend,
},
[VIS_ACTION_CURSOR_CHAR_PREV] = {
"vis-motion-char-prev",
VIS_HELP("Move cursor left, to the previous character")
movement, { .i = VIS_MOVE_CHAR_PREV }
},
[VIS_ACTION_CURSOR_CHAR_NEXT] = {
"vis-motion-char-next",
VIS_HELP("Move cursor right, to the next character")
movement, { .i = VIS_MOVE_CHAR_NEXT }
},
[VIS_ACTION_CURSOR_LINE_CHAR_PREV] = {
"vis-motion-line-char-prev",
VIS_HELP("Move cursor left, to the previous character on the same line")
movement, { .i = VIS_MOVE_LINE_CHAR_PREV }
},
[VIS_ACTION_CURSOR_LINE_CHAR_NEXT] = {
"vis-motion-line-char-next",
VIS_HELP("Move cursor right, to the next character on the same line")
movement, { .i = VIS_MOVE_LINE_CHAR_NEXT }
},
[VIS_ACTION_CURSOR_CODEPOINT_PREV] = {
"vis-motion-codepoint-prev",
VIS_HELP("Move to the previous Unicode codepoint")
movement, { .i = VIS_MOVE_CODEPOINT_PREV }
},
[VIS_ACTION_CURSOR_CODEPOINT_NEXT] = {
"vis-motion-codepoint-next",
VIS_HELP("Move to the next Unicode codepoint")
movement, { .i = VIS_MOVE_CODEPOINT_NEXT }
},
[VIS_ACTION_CURSOR_WORD_START_PREV] = {
"vis-motion-word-start-prev",
VIS_HELP("Move cursor words backwards")
movement, { .i = VIS_MOVE_WORD_START_PREV }
},
[VIS_ACTION_CURSOR_WORD_START_NEXT] = {
"vis-motion-word-start-next",
VIS_HELP("Move cursor words forwards")
movement, { .i = VIS_MOVE_WORD_START_NEXT }
},
[VIS_ACTION_CURSOR_WORD_END_PREV] = {
"vis-motion-word-end-prev",
VIS_HELP("Move cursor backwards to the end of word")
movement, { .i = VIS_MOVE_WORD_END_PREV }
},
[VIS_ACTION_CURSOR_WORD_END_NEXT] = {
"vis-motion-word-end-next",
VIS_HELP("Move cursor forward to the end of word")
movement, { .i = VIS_MOVE_WORD_END_NEXT }
},
[VIS_ACTION_CURSOR_LONGWORD_START_PREV] = {
"vis-motion-bigword-start-prev",
VIS_HELP("Move cursor WORDS backwards")
movement, { .i = VIS_MOVE_LONGWORD_START_PREV }
},
[VIS_ACTION_CURSOR_LONGWORD_START_NEXT] = {
"vis-motion-bigword-start-next",
VIS_HELP("Move cursor WORDS forwards")
movement, { .i = VIS_MOVE_LONGWORD_START_NEXT }
},
[VIS_ACTION_CURSOR_LONGWORD_END_PREV] = {
"vis-motion-bigword-end-prev",
VIS_HELP("Move cursor backwards to the end of WORD")
movement, { .i = VIS_MOVE_LONGWORD_END_PREV }
},
[VIS_ACTION_CURSOR_LONGWORD_END_NEXT] = {
"vis-motion-bigword-end-next",
VIS_HELP("Move cursor forward to the end of WORD")
movement, { .i = VIS_MOVE_LONGWORD_END_NEXT }
},
[VIS_ACTION_CURSOR_LINE_UP] = {
"vis-motion-line-up",
VIS_HELP("Move cursor line upwards")
movement, { .i = VIS_MOVE_LINE_UP }
},
[VIS_ACTION_CURSOR_LINE_DOWN] = {
"vis-motion-line-down",
VIS_HELP("Move cursor line downwards")
movement, { .i = VIS_MOVE_LINE_DOWN }
},
[VIS_ACTION_CURSOR_LINE_START] = {
"vis-motion-line-start",
VIS_HELP("Move cursor to first non-blank character of the line")
movement, { .i = VIS_MOVE_LINE_START }
},
[VIS_ACTION_CURSOR_LINE_FINISH] = {
"vis-motion-line-finish",
VIS_HELP("Move cursor to last non-blank character of the line")
movement, { .i = VIS_MOVE_LINE_FINISH }
},
[VIS_ACTION_CURSOR_LINE_BEGIN] = {
"vis-motion-line-begin",
VIS_HELP("Move cursor to first character of the line")
movement, { .i = VIS_MOVE_LINE_BEGIN }
},
[VIS_ACTION_CURSOR_LINE_END] = {
"vis-motion-line-end",
VIS_HELP("Move cursor to end of the line")
movement, { .i = VIS_MOVE_LINE_END }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_UP] = {
"vis-motion-screenline-up",
VIS_HELP("Move cursor screen/display line upwards")
movement, { .i = VIS_MOVE_SCREEN_LINE_UP }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_DOWN] = {
"vis-motion-screenline-down",
VIS_HELP("Move cursor screen/display line downwards")
movement, { .i = VIS_MOVE_SCREEN_LINE_DOWN }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_BEGIN] = {
"vis-motion-screenline-begin",
VIS_HELP("Move cursor to beginning of screen/display line")
movement, { .i = VIS_MOVE_SCREEN_LINE_BEGIN }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_MIDDLE] = {
"vis-motion-screenline-middle",
VIS_HELP("Move cursor to middle of screen/display line")
movement, { .i = VIS_MOVE_SCREEN_LINE_MIDDLE }
},
[VIS_ACTION_CURSOR_SCREEN_LINE_END] = {
"vis-motion-screenline-end",
VIS_HELP("Move cursor to end of screen/display line")
movement, { .i = VIS_MOVE_SCREEN_LINE_END }
},
[VIS_ACTION_CURSOR_PERCENT] = {
"vis-motion-percent",
VIS_HELP("Move to count % of file or matching item")
percent
},
[VIS_ACTION_CURSOR_BYTE] = {
"vis-motion-byte",
VIS_HELP("Move to absolute byte position")
movement, { .i = VIS_MOVE_BYTE }
},
[VIS_ACTION_CURSOR_BYTE_LEFT] = {
"vis-motion-byte-left",
VIS_HELP("Move count bytes to the left")
movement, { .i = VIS_MOVE_BYTE_LEFT }
},
[VIS_ACTION_CURSOR_BYTE_RIGHT] = {
"vis-motion-byte-right",
VIS_HELP("Move count bytes to the right")
movement, { .i = VIS_MOVE_BYTE_RIGHT }
},
[VIS_ACTION_CURSOR_PARAGRAPH_PREV] = {
"vis-motion-paragraph-prev",
VIS_HELP("Move cursor paragraph backward")
movement, { .i = VIS_MOVE_PARAGRAPH_PREV }
},
[VIS_ACTION_CURSOR_PARAGRAPH_NEXT] = {
"vis-motion-paragraph-next",
VIS_HELP("Move cursor paragraph forward")
movement, { .i = VIS_MOVE_PARAGRAPH_NEXT }
},
[VIS_ACTION_CURSOR_SENTENCE_PREV] = {
"vis-motion-sentence-prev",
VIS_HELP("Move cursor sentence backward")
movement, { .i = VIS_MOVE_SENTENCE_PREV }
},
[VIS_ACTION_CURSOR_SENTENCE_NEXT] = {
"vis-motion-sentence-next",
VIS_HELP("Move cursor sentence forward")
movement, { .i = VIS_MOVE_SENTENCE_NEXT }
},
[VIS_ACTION_CURSOR_BLOCK_START] = {
"vis-motion-block-start",
VIS_HELP("Move cursor to the opening curly brace in a block")
movement, { .i = VIS_MOVE_BLOCK_START }
},
[VIS_ACTION_CURSOR_BLOCK_END] = {
"vis-motion-block-end",
VIS_HELP("Move cursor to the closing curly brace in a block")
movement, { .i = VIS_MOVE_BLOCK_END }
},
[VIS_ACTION_CURSOR_PARENTHESE_START] = {
"vis-motion-parenthese-start",
VIS_HELP("Move cursor to the opening parenthese inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESE_START }
},
[VIS_ACTION_CURSOR_PARENTHESE_END] = {
"vis-motion-parenthese-end",
VIS_HELP("Move cursor to the closing parenthese inside a pair of parentheses")
movement, { .i = VIS_MOVE_PARENTHESE_END }
},
[VIS_ACTION_CURSOR_COLUMN] = {
"vis-motion-column",
VIS_HELP("Move cursor to given column of current line")
movement, { .i = VIS_MOVE_COLUMN }
},
[VIS_ACTION_CURSOR_LINE_FIRST] = {
"vis-motion-line-first",
VIS_HELP("Move cursor to given line (defaults to first)")
gotoline, { .i = -1 }
},
[VIS_ACTION_CURSOR_LINE_LAST] = {
"vis-motion-line-last",
VIS_HELP("Move cursor to given line (defaults to last)")
gotoline, { .i = +1 }
},
[VIS_ACTION_CURSOR_WINDOW_LINE_TOP] = {
"vis-motion-window-line-top",
VIS_HELP("Move cursor to top line of the window")
movement, { .i = VIS_MOVE_WINDOW_LINE_TOP }
},
[VIS_ACTION_CURSOR_WINDOW_LINE_MIDDLE] = {
"vis-motion-window-line-middle",
VIS_HELP("Move cursor to middle line of the window")
movement, { .i = VIS_MOVE_WINDOW_LINE_MIDDLE }
},
[VIS_ACTION_CURSOR_WINDOW_LINE_BOTTOM] = {
"vis-motion-window-line-bottom",
VIS_HELP("Move cursor to bottom line of the window")
movement, { .i = VIS_MOVE_WINDOW_LINE_BOTTOM }
},
[VIS_ACTION_CURSOR_SEARCH_REPEAT_FORWARD] = {
"vis-motion-search-repeat-forward",
VIS_HELP("Move cursor to next match in forward direction")
movement, { .i = VIS_MOVE_SEARCH_REPEAT_FORWARD }
},
[VIS_ACTION_CURSOR_SEARCH_REPEAT_BACKWARD] = {
"vis-motion-search-repeat-backward",
VIS_HELP("Move cursor to previous match in backward direction")
movement, { .i = VIS_MOVE_SEARCH_REPEAT_BACKWARD }
},
[VIS_ACTION_CURSOR_SEARCH_REPEAT] = {
"vis-motion-search-repeat",
VIS_HELP("Move cursor to next match")
movement, { .i = VIS_MOVE_SEARCH_REPEAT }
},
[VIS_ACTION_CURSOR_SEARCH_REPEAT_REVERSE] = {
"vis-motion-search-repeat-reverse",
VIS_HELP("Move cursor to next match in opposite direction")
movement, { .i = VIS_MOVE_SEARCH_REPEAT_REVERSE }
},
[VIS_ACTION_CURSOR_SEARCH_WORD_FORWARD] = {
"vis-motion-search-word-forward",
VIS_HELP("Move cursor to next occurrence of the word under cursor")
movement, { .i = VIS_MOVE_SEARCH_WORD_FORWARD }
},
[VIS_ACTION_CURSOR_SEARCH_WORD_BACKWARD] = {
"vis-motion-search-word-backward",
VIS_HELP("Move cursor to previous occurrence of the word under cursor")
movement, { .i = VIS_MOVE_SEARCH_WORD_BACKWARD }
},
[VIS_ACTION_WINDOW_PAGE_UP] = {
"vis-window-page-up",
VIS_HELP("Scroll window pages backwards (upwards)")
wscroll, { .i = -PAGE }
},
[VIS_ACTION_WINDOW_HALFPAGE_UP] = {
"vis-window-halfpage-up",
VIS_HELP("Scroll window half pages backwards (upwards)")
wscroll, { .i = -PAGE_HALF }
},
[VIS_ACTION_WINDOW_PAGE_DOWN] = {
"vis-window-page-down",
VIS_HELP("Scroll window pages forwards (downwards)")
wscroll, { .i = +PAGE }
},
[VIS_ACTION_WINDOW_HALFPAGE_DOWN] = {
"vis-window-halfpage-down",
VIS_HELP("Scroll window half pages forwards (downwards)")
wscroll, { .i = +PAGE_HALF }
},
[VIS_ACTION_MODE_NORMAL] = {
"vis-mode-normal",
VIS_HELP("Enter normal mode")
switchmode, { .i = VIS_MODE_NORMAL }
},
[VIS_ACTION_MODE_VISUAL] = {
"vis-mode-visual-charwise",
VIS_HELP("Enter characterwise visual mode")
switchmode, { .i = VIS_MODE_VISUAL }
},
[VIS_ACTION_MODE_VISUAL_LINE] = {
"vis-mode-visual-linewise",
VIS_HELP("Enter linewise visual mode")
switchmode, { .i = VIS_MODE_VISUAL_LINE }
},
[VIS_ACTION_MODE_INSERT] = {
"vis-mode-insert",
VIS_HELP("Enter insert mode")
insertmode, { .i = VIS_MOVE_NOP }
},
[VIS_ACTION_MODE_REPLACE] = {
"vis-mode-replace",
VIS_HELP("Enter replace mode")
replacemode, { .i = VIS_MOVE_NOP }
},
[VIS_ACTION_DELETE_CHAR_PREV] = {
"vis-delete-char-prev",
VIS_HELP("Delete the previous character")
delete, { .i = VIS_MOVE_CHAR_PREV }
},
[VIS_ACTION_DELETE_CHAR_NEXT] = {
"vis-delete-char-next",
VIS_HELP("Delete the next character")
delete, { .i = VIS_MOVE_CHAR_NEXT }
},
[VIS_ACTION_DELETE_LINE_BEGIN] = {
"vis-delete-line-begin",
VIS_HELP("Delete until the start of the current line")
delete, { .i = VIS_MOVE_LINE_BEGIN }
},
[VIS_ACTION_DELETE_WORD_PREV] = {
"vis-delete-word-prev",
VIS_HELP("Delete the previous WORD")
delete, { .i = VIS_MOVE_WORD_START_PREV }
},
[VIS_ACTION_JUMPLIST_PREV] = {
"vis-jumplist-prev",
VIS_HELP("Go to older cursor position in jump list")
jumplist, { .i = -1 }
},
[VIS_ACTION_JUMPLIST_NEXT] = {
"vis-jumplist-next",
VIS_HELP("Go to newer cursor position in jump list")
jumplist, { .i = +1 }
},
[VIS_ACTION_JUMPLIST_SAVE] = {
"vis-jumplist-save",
VIS_HELP("Save current selections in jump list")
jumplist, { .i = 0 }
},
[VIS_ACTION_UNDO] = {
"vis-undo",
VIS_HELP("Undo last change")
undo,
},
[VIS_ACTION_REDO] = {
"vis-redo",
VIS_HELP("Redo last change")
redo,
},
[VIS_ACTION_EARLIER] = {
"vis-earlier",
VIS_HELP("Goto older text state")
earlier,
},
[VIS_ACTION_LATER] = {
"vis-later",
VIS_HELP("Goto newer text state")
later,
},
[VIS_ACTION_MACRO_RECORD] = {
"vis-macro-record",
VIS_HELP("Record macro into given register")
macro_record,
},
[VIS_ACTION_MACRO_REPLAY] = {
"vis-macro-replay",
VIS_HELP("Replay macro, execute the content of the given register")
macro_replay,
},
[VIS_ACTION_MARK] = {
"vis-mark",
VIS_HELP("Use given mark for next action")
mark,
},
[VIS_ACTION_REDRAW] = {
"vis-redraw",
VIS_HELP("Redraw current editor content")
call, { .f = vis_redraw }
},
[VIS_ACTION_REPLACE_CHAR] = {
"vis-replace-char",
VIS_HELP("Replace the character under the cursor")
replace,
},
[VIS_ACTION_TOTILL_REPEAT] = {
"vis-motion-totill-repeat",
VIS_HELP("Repeat latest to/till motion")
movement, { .i = VIS_MOVE_TOTILL_REPEAT }
},
[VIS_ACTION_TOTILL_REVERSE] = {
"vis-motion-totill-reverse",
VIS_HELP("Repeat latest to/till motion but in opposite direction")
movement, { .i = VIS_MOVE_TOTILL_REVERSE }
},
[VIS_ACTION_PROMPT_SEARCH_FORWARD] = {
"vis-search-forward",
VIS_HELP("Search forward")
prompt_show, { .s = "/" }
},
[VIS_ACTION_PROMPT_SEARCH_BACKWARD] = {
"vis-search-backward",
VIS_HELP("Search backward")
prompt_show, { .s = "?" }
},
[VIS_ACTION_TILL_LEFT] = {
"vis-motion-till-left",
VIS_HELP("Till after the occurrence of character to the left")
movement_key, { .i = VIS_MOVE_LEFT_TILL }
},
[VIS_ACTION_TILL_RIGHT] = {
"vis-motion-till-right",
VIS_HELP("Till before the occurrence of character to the right")
movement_key, { .i = VIS_MOVE_RIGHT_TILL }
},
[VIS_ACTION_TO_LEFT] = {
"vis-motion-to-left",
VIS_HELP("To the first occurrence of character to the left")
movement_key, { .i = VIS_MOVE_LEFT_TO }
},
[VIS_ACTION_TO_RIGHT] = {
"vis-motion-to-right",
VIS_HELP("To the first occurrence of character to the right")
movement_key, { .i = VIS_MOVE_RIGHT_TO }
},
[VIS_ACTION_REGISTER] = {
"vis-register",
VIS_HELP("Use given register for next operator")
reg,
},
[VIS_ACTION_OPERATOR_CHANGE] = {
"vis-operator-change",
VIS_HELP("Change operator")
operator, { .i = VIS_OP_CHANGE }
},
[VIS_ACTION_OPERATOR_DELETE] = {
"vis-operator-delete",
VIS_HELP("Delete operator")
operator, { .i = VIS_OP_DELETE }
},
[VIS_ACTION_OPERATOR_YANK] = {
"vis-operator-yank",
VIS_HELP("Yank operator")
operator, { .i = VIS_OP_YANK }
},
[VIS_ACTION_OPERATOR_SHIFT_LEFT] = {
"vis-operator-shift-left",
VIS_HELP("Shift left operator")
operator, { .i = VIS_OP_SHIFT_LEFT }
},
[VIS_ACTION_OPERATOR_SHIFT_RIGHT] = {
"vis-operator-shift-right",
VIS_HELP("Shift right operator")
operator, { .i = VIS_OP_SHIFT_RIGHT }
},
[VIS_ACTION_OPERATOR_CASE_LOWER] = {
"vis-operator-case-lower",
VIS_HELP("Lowercase operator")
operator, { .i = VIS_OP_CASE_LOWER }
},
[VIS_ACTION_OPERATOR_CASE_UPPER] = {
"vis-operator-case-upper",
VIS_HELP("Uppercase operator")
operator, { .i = VIS_OP_CASE_UPPER }
},
[VIS_ACTION_OPERATOR_CASE_SWAP] = {
"vis-operator-case-swap",
VIS_HELP("Swap case operator")
operator, { .i = VIS_OP_CASE_SWAP }
},
[VIS_ACTION_COUNT] = {
"vis-count",
VIS_HELP("Count specifier")
count,
},
[VIS_ACTION_INSERT_NEWLINE] = {
"vis-insert-newline",
VIS_HELP("Insert a line break (depending on file type)")
call, { .f = vis_insert_nl }
},
[VIS_ACTION_INSERT_TAB] = {
"vis-insert-tab",
VIS_HELP("Insert a tab (might be converted to spaces)")
call, { .f = vis_insert_tab }
},
[VIS_ACTION_INSERT_VERBATIM] = {
"vis-insert-verbatim",
VIS_HELP("Insert Unicode character based on code point")
insert_verbatim,
},
[VIS_ACTION_INSERT_REGISTER] = {
"vis-insert-register",
VIS_HELP("Insert specified register content")
insert_register,
},
[VIS_ACTION_WINDOW_NEXT] = {
"vis-window-next",
VIS_HELP("Focus next window")
call, { .f = vis_window_next }
},
[VIS_ACTION_WINDOW_PREV] = {
"vis-window-prev",
VIS_HELP("Focus previous window")
call, { .f = vis_window_prev }
},
[VIS_ACTION_APPEND_CHAR_NEXT] = {
"vis-append-char-next",
VIS_HELP("Append text after the cursor")
insertmode, { .i = VIS_MOVE_LINE_CHAR_NEXT }
},
[VIS_ACTION_APPEND_LINE_END] = {
"vis-append-line-end",
VIS_HELP("Append text after the end of the line")
insertmode, { .i = VIS_MOVE_LINE_END },
},
[VIS_ACTION_INSERT_LINE_START] = {
"vis-insert-line-start",
VIS_HELP("Insert text before the first non-blank in the line")
insertmode, { .i = VIS_MOVE_LINE_START },
},
[VIS_ACTION_OPEN_LINE_ABOVE] = {
"vis-open-line-above",
VIS_HELP("Begin a new line above the cursor")
openline, { .i = -1 }
},
[VIS_ACTION_OPEN_LINE_BELOW] = {
"vis-open-line-below",
VIS_HELP("Begin a new line below the cursor")
openline, { .i = +1 }
},
[VIS_ACTION_JOIN_LINES] = {
"vis-join-lines",
VIS_HELP("Join selected lines")
join, { .s = " " }
},
[VIS_ACTION_JOIN_LINES_TRIM] = {
"vis-join-lines-trim",
VIS_HELP("Join selected lines, remove white space")
join, { .s = "" }
},
[VIS_ACTION_PROMPT_SHOW] = {
"vis-prompt-show",
VIS_HELP("Show editor command line prompt")
prompt_show, { .s = ":" }
},
[VIS_ACTION_REPEAT] = {
"vis-repeat",
VIS_HELP("Repeat latest editor command")
repeat
},
[VIS_ACTION_SELECTION_FLIP] = {
"vis-selection-flip",
VIS_HELP("Flip selection, move cursor to other end")
selection_end,
},
[VIS_ACTION_WINDOW_REDRAW_TOP] = {
"vis-window-redraw-top",
VIS_HELP("Redraw cursor line at the top of the window")
window, { .w = view_redraw_top }
},
[VIS_ACTION_WINDOW_REDRAW_CENTER] = {
"vis-window-redraw-center",
VIS_HELP("Redraw cursor line at the center of the window")
window, { .w = view_redraw_center }
},
[VIS_ACTION_WINDOW_REDRAW_BOTTOM] = {
"vis-window-redraw-bottom",
VIS_HELP("Redraw cursor line at the bottom of the window")
window, { .w = view_redraw_bottom }
},
[VIS_ACTION_WINDOW_SLIDE_UP] = {
"vis-window-slide-up",
VIS_HELP("Slide window content upwards")
wslide, { .i = -1 }
},
[VIS_ACTION_WINDOW_SLIDE_DOWN] = {
"vis-window-slide-down",
VIS_HELP("Slide window content downwards")
wslide, { .i = +1 }
},
[VIS_ACTION_PUT_AFTER] = {
"vis-put-after",
VIS_HELP("Put text after the cursor")
operator, { .i = VIS_OP_PUT_AFTER }
},
[VIS_ACTION_PUT_BEFORE] = {
"vis-put-before",
VIS_HELP("Put text before the cursor")
operator, { .i = VIS_OP_PUT_BEFORE }
},
[VIS_ACTION_PUT_AFTER_END] = {
"vis-put-after-end",
VIS_HELP("Put text after the cursor, place cursor after new text")
operator, { .i = VIS_OP_PUT_AFTER_END }
},
[VIS_ACTION_PUT_BEFORE_END] = {
"vis-put-before-end",
VIS_HELP("Put text before the cursor, place cursor after new text")
operator, { .i = VIS_OP_PUT_BEFORE_END }
},
[VIS_ACTION_SELECTIONS_MATCH_WORD] = {
"vis-selections-select-word",
VIS_HELP("Select word under cursor")
selections_match_word,
},
[VIS_ACTION_SELECTIONS_NEW_LINE_ABOVE] = {
"vis-selection-new-lines-above",
VIS_HELP("Create a new selection on the line above")
selections_new, { .i = -1 }
},
[VIS_ACTION_SELECTIONS_NEW_LINE_ABOVE_FIRST] = {
"vis-selection-new-lines-above-first",
VIS_HELP("Create a new selection on the line above the first selection")
selections_new, { .i = INT_MIN }
},
[VIS_ACTION_SELECTIONS_NEW_LINE_BELOW] = {
"vis-selection-new-lines-below",
VIS_HELP("Create a new selection on the line below")
selections_new, { .i = +1 }
},
[VIS_ACTION_SELECTIONS_NEW_LINE_BELOW_LAST] = {
"vis-selection-new-lines-below-last",
VIS_HELP("Create a new selection on the line below the last selection")
selections_new, { .i = INT_MAX }
},
[VIS_ACTION_SELECTIONS_NEW_LINES_BEGIN] = {
"vis-selection-new-lines-begin",
VIS_HELP("Create a new selection at the start of every line covered by selection")
operator, { .i = VIS_OP_CURSOR_SOL }
},
[VIS_ACTION_SELECTIONS_NEW_LINES_END] = {
"vis-selection-new-lines-end",
VIS_HELP("Create a new selection at the end of every line covered by selection")
operator, { .i = VIS_OP_CURSOR_EOL }
},
[VIS_ACTION_SELECTIONS_NEW_MATCH_NEXT] = {
"vis-selection-new-match-next",
VIS_HELP("Select the next region matching the current selection")
selections_match_next,
},
[VIS_ACTION_SELECTIONS_NEW_MATCH_SKIP] = {
"vis-selection-new-match-skip",
VIS_HELP("Clear current selection, but select next match")
selections_match_skip,
},
[VIS_ACTION_SELECTIONS_ALIGN] = {
"vis-selections-align",
VIS_HELP("Try to align all selections on the same column")
selections_align,
},
[VIS_ACTION_SELECTIONS_ALIGN_INDENT_LEFT] = {
"vis-selections-align-indent-left",
VIS_HELP("Left align all selections/selections by inserting spaces")
selections_align_indent, { .i = -1 }
},
[VIS_ACTION_SELECTIONS_ALIGN_INDENT_RIGHT] = {
"vis-selections-align-indent-right",
VIS_HELP("Right align all selections/selections by inserting spaces")
selections_align_indent, { .i = +1 }
},
[VIS_ACTION_SELECTIONS_REMOVE_ALL] = {
"vis-selections-remove-all",
VIS_HELP("Remove all but the primary selection")
selections_clear,
},
[VIS_ACTION_SELECTIONS_REMOVE_LAST] = {
"vis-selections-remove-last",
VIS_HELP("Remove least recently created selection")
selections_remove,
},
[VIS_ACTION_SELECTIONS_REMOVE_COLUMN] = {
"vis-selections-remove-column",
VIS_HELP("Remove count selection column")
selections_remove_column, { .i = 1 }