reline 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/BSDL +22 -0
- data/COPYING +56 -0
- data/README.md +9 -0
- data/lib/reline.rb +431 -0
- data/lib/reline/ansi.rb +177 -0
- data/lib/reline/config.rb +288 -0
- data/lib/reline/general_io.rb +75 -0
- data/lib/reline/history.rb +56 -0
- data/lib/reline/key_actor.rb +7 -0
- data/lib/reline/key_actor/base.rb +7 -0
- data/lib/reline/key_actor/emacs.rb +517 -0
- data/lib/reline/key_actor/vi_command.rb +518 -0
- data/lib/reline/key_actor/vi_insert.rb +517 -0
- data/lib/reline/key_stroke.rb +53 -0
- data/lib/reline/kill_ring.rb +113 -0
- data/lib/reline/line_editor.rb +2231 -0
- data/lib/reline/unicode.rb +527 -0
- data/lib/reline/unicode/east_asian_width.rb +1145 -0
- data/lib/reline/version.rb +3 -0
- data/lib/reline/windows.rb +273 -0
- metadata +119 -0
@@ -0,0 +1,518 @@
|
|
1
|
+
class Reline::KeyActor::ViCommand < Reline::KeyActor::Base
|
2
|
+
MAPPING = [
|
3
|
+
# 0 ^@
|
4
|
+
:ed_unassigned,
|
5
|
+
# 1 ^A
|
6
|
+
:ed_move_to_beg,
|
7
|
+
# 2 ^B
|
8
|
+
:ed_unassigned,
|
9
|
+
# 3 ^C
|
10
|
+
:ed_ignore,
|
11
|
+
# 4 ^D
|
12
|
+
:vi_end_of_transmission,
|
13
|
+
# 5 ^E
|
14
|
+
:ed_move_to_end,
|
15
|
+
# 6 ^F
|
16
|
+
:ed_unassigned,
|
17
|
+
# 7 ^G
|
18
|
+
:ed_unassigned,
|
19
|
+
# 8 ^H
|
20
|
+
:ed_delete_prev_char,
|
21
|
+
# 9 ^I
|
22
|
+
:ed_unassigned,
|
23
|
+
# 10 ^J
|
24
|
+
:ed_newline,
|
25
|
+
# 11 ^K
|
26
|
+
:ed_kill_line,
|
27
|
+
# 12 ^L
|
28
|
+
:ed_clear_screen,
|
29
|
+
# 13 ^M
|
30
|
+
:ed_newline,
|
31
|
+
# 14 ^N
|
32
|
+
:ed_next_history,
|
33
|
+
# 15 ^O
|
34
|
+
:ed_ignore,
|
35
|
+
# 16 ^P
|
36
|
+
:ed_prev_history,
|
37
|
+
# 17 ^Q
|
38
|
+
:ed_ignore,
|
39
|
+
# 18 ^R
|
40
|
+
:ed_search_prev_history,
|
41
|
+
# 19 ^S
|
42
|
+
:ed_ignore,
|
43
|
+
# 20 ^T
|
44
|
+
:ed_unassigned,
|
45
|
+
# 21 ^U
|
46
|
+
:vi_kill_line_prev,
|
47
|
+
# 22 ^V
|
48
|
+
:ed_quoted_insert,
|
49
|
+
# 23 ^W
|
50
|
+
:ed_delete_prev_word,
|
51
|
+
# 24 ^X
|
52
|
+
:ed_unassigned,
|
53
|
+
# 25 ^Y
|
54
|
+
:ed_unassigned,
|
55
|
+
# 26 ^Z
|
56
|
+
:ed_unassigned,
|
57
|
+
# 27 ^[
|
58
|
+
:ed_unassigned,
|
59
|
+
# 28 ^\
|
60
|
+
:ed_ignore,
|
61
|
+
# 29 ^]
|
62
|
+
:ed_unassigned,
|
63
|
+
# 30 ^^
|
64
|
+
:ed_unassigned,
|
65
|
+
# 31 ^_
|
66
|
+
:ed_unassigned,
|
67
|
+
# 32 SPACE
|
68
|
+
:ed_next_char,
|
69
|
+
# 33 !
|
70
|
+
:ed_unassigned,
|
71
|
+
# 34 "
|
72
|
+
:ed_unassigned,
|
73
|
+
# 35 #
|
74
|
+
:vi_comment_out,
|
75
|
+
# 36 $
|
76
|
+
:ed_move_to_end,
|
77
|
+
# 37 %
|
78
|
+
:vi_match,
|
79
|
+
# 38 &
|
80
|
+
:ed_unassigned,
|
81
|
+
# 39 '
|
82
|
+
:ed_unassigned,
|
83
|
+
# 40 (
|
84
|
+
:ed_unassigned,
|
85
|
+
# 41 )
|
86
|
+
:ed_unassigned,
|
87
|
+
# 42 *
|
88
|
+
:ed_unassigned,
|
89
|
+
# 43 +
|
90
|
+
:ed_next_history,
|
91
|
+
# 44 ,
|
92
|
+
:vi_repeat_prev_char,
|
93
|
+
# 45 -
|
94
|
+
:ed_prev_history,
|
95
|
+
# 46 .
|
96
|
+
:vi_redo,
|
97
|
+
# 47 /
|
98
|
+
:vi_search_prev,
|
99
|
+
# 48 0
|
100
|
+
:vi_zero,
|
101
|
+
# 49 1
|
102
|
+
:ed_argument_digit,
|
103
|
+
# 50 2
|
104
|
+
:ed_argument_digit,
|
105
|
+
# 51 3
|
106
|
+
:ed_argument_digit,
|
107
|
+
# 52 4
|
108
|
+
:ed_argument_digit,
|
109
|
+
# 53 5
|
110
|
+
:ed_argument_digit,
|
111
|
+
# 54 6
|
112
|
+
:ed_argument_digit,
|
113
|
+
# 55 7
|
114
|
+
:ed_argument_digit,
|
115
|
+
# 56 8
|
116
|
+
:ed_argument_digit,
|
117
|
+
# 57 9
|
118
|
+
:ed_argument_digit,
|
119
|
+
# 58 :
|
120
|
+
:ed_command,
|
121
|
+
# 59 ;
|
122
|
+
:vi_repeat_next_char,
|
123
|
+
# 60 <
|
124
|
+
:ed_unassigned,
|
125
|
+
# 61 =
|
126
|
+
:ed_unassigned,
|
127
|
+
# 62 >
|
128
|
+
:ed_unassigned,
|
129
|
+
# 63 ?
|
130
|
+
:vi_search_next,
|
131
|
+
# 64 @
|
132
|
+
:vi_alias,
|
133
|
+
# 65 A
|
134
|
+
:vi_add_at_eol,
|
135
|
+
# 66 B
|
136
|
+
:vi_prev_big_word,
|
137
|
+
# 67 C
|
138
|
+
:vi_change_to_eol,
|
139
|
+
# 68 D
|
140
|
+
:ed_kill_line,
|
141
|
+
# 69 E
|
142
|
+
:vi_end_big_word,
|
143
|
+
# 70 F
|
144
|
+
:vi_prev_char,
|
145
|
+
# 71 G
|
146
|
+
:vi_to_history_line,
|
147
|
+
# 72 H
|
148
|
+
:ed_unassigned,
|
149
|
+
# 73 I
|
150
|
+
:vi_insert_at_bol,
|
151
|
+
# 74 J
|
152
|
+
:vi_join_lines,
|
153
|
+
# 75 K
|
154
|
+
:ed_search_prev_history,
|
155
|
+
# 76 L
|
156
|
+
:ed_unassigned,
|
157
|
+
# 77 M
|
158
|
+
:ed_unassigned,
|
159
|
+
# 78 N
|
160
|
+
:vi_repeat_search_prev,
|
161
|
+
# 79 O
|
162
|
+
:ed_sequence_lead_in,
|
163
|
+
# 80 P
|
164
|
+
:vi_paste_prev,
|
165
|
+
# 81 Q
|
166
|
+
:ed_unassigned,
|
167
|
+
# 82 R
|
168
|
+
:vi_replace_mode,
|
169
|
+
# 83 S
|
170
|
+
:vi_substitute_line,
|
171
|
+
# 84 T
|
172
|
+
:vi_to_prev_char,
|
173
|
+
# 85 U
|
174
|
+
:vi_undo_line,
|
175
|
+
# 86 V
|
176
|
+
:ed_unassigned,
|
177
|
+
# 87 W
|
178
|
+
:vi_next_big_word,
|
179
|
+
# 88 X
|
180
|
+
:ed_delete_prev_char,
|
181
|
+
# 89 Y
|
182
|
+
:vi_yank_end,
|
183
|
+
# 90 Z
|
184
|
+
:ed_unassigned,
|
185
|
+
# 91 [
|
186
|
+
:ed_sequence_lead_in,
|
187
|
+
# 92 \
|
188
|
+
:ed_unassigned,
|
189
|
+
# 93 ]
|
190
|
+
:ed_unassigned,
|
191
|
+
# 94 ^
|
192
|
+
:vi_first_print,
|
193
|
+
# 95 _
|
194
|
+
:vi_history_word,
|
195
|
+
# 96 `
|
196
|
+
:ed_unassigned,
|
197
|
+
# 97 a
|
198
|
+
:vi_add,
|
199
|
+
# 98 b
|
200
|
+
:vi_prev_word,
|
201
|
+
# 99 c
|
202
|
+
:vi_change_meta,
|
203
|
+
# 100 d
|
204
|
+
:vi_delete_meta,
|
205
|
+
# 101 e
|
206
|
+
:vi_end_word,
|
207
|
+
# 102 f
|
208
|
+
:vi_next_char,
|
209
|
+
# 103 g
|
210
|
+
:ed_unassigned,
|
211
|
+
# 104 h
|
212
|
+
:ed_prev_char,
|
213
|
+
# 105 i
|
214
|
+
:vi_insert,
|
215
|
+
# 106 j
|
216
|
+
:ed_next_history,
|
217
|
+
# 107 k
|
218
|
+
:ed_prev_history,
|
219
|
+
# 108 l
|
220
|
+
:ed_next_char,
|
221
|
+
# 109 m
|
222
|
+
:ed_unassigned,
|
223
|
+
# 110 n
|
224
|
+
:vi_repeat_search_next,
|
225
|
+
# 111 o
|
226
|
+
:ed_unassigned,
|
227
|
+
# 112 p
|
228
|
+
:vi_paste_next,
|
229
|
+
# 113 q
|
230
|
+
:ed_unassigned,
|
231
|
+
# 114 r
|
232
|
+
:vi_replace_char,
|
233
|
+
# 115 s
|
234
|
+
:vi_substitute_char,
|
235
|
+
# 116 t
|
236
|
+
:vi_to_next_char,
|
237
|
+
# 117 u
|
238
|
+
:vi_undo,
|
239
|
+
# 118 v
|
240
|
+
:vi_histedit,
|
241
|
+
# 119 w
|
242
|
+
:vi_next_word,
|
243
|
+
# 120 x
|
244
|
+
:ed_delete_next_char,
|
245
|
+
# 121 y
|
246
|
+
:vi_yank,
|
247
|
+
# 122 z
|
248
|
+
:ed_unassigned,
|
249
|
+
# 123 {
|
250
|
+
:ed_unassigned,
|
251
|
+
# 124 |
|
252
|
+
:vi_to_column,
|
253
|
+
# 125 }
|
254
|
+
:ed_unassigned,
|
255
|
+
# 126 ~
|
256
|
+
:vi_change_case,
|
257
|
+
# 127 ^?
|
258
|
+
:ed_delete_prev_char,
|
259
|
+
# 128 M-^@
|
260
|
+
:ed_unassigned,
|
261
|
+
# 129 M-^A
|
262
|
+
:ed_unassigned,
|
263
|
+
# 130 M-^B
|
264
|
+
:ed_unassigned,
|
265
|
+
# 131 M-^C
|
266
|
+
:ed_unassigned,
|
267
|
+
# 132 M-^D
|
268
|
+
:ed_unassigned,
|
269
|
+
# 133 M-^E
|
270
|
+
:ed_unassigned,
|
271
|
+
# 134 M-^F
|
272
|
+
:ed_unassigned,
|
273
|
+
# 135 M-^G
|
274
|
+
:ed_unassigned,
|
275
|
+
# 136 M-^H
|
276
|
+
:ed_unassigned,
|
277
|
+
# 137 M-^I
|
278
|
+
:ed_unassigned,
|
279
|
+
# 138 M-^J
|
280
|
+
:ed_unassigned,
|
281
|
+
# 139 M-^K
|
282
|
+
:ed_unassigned,
|
283
|
+
# 140 M-^L
|
284
|
+
:ed_unassigned,
|
285
|
+
# 141 M-^M
|
286
|
+
:ed_unassigned,
|
287
|
+
# 142 M-^N
|
288
|
+
:ed_unassigned,
|
289
|
+
# 143 M-^O
|
290
|
+
:ed_unassigned,
|
291
|
+
# 144 M-^P
|
292
|
+
:ed_unassigned,
|
293
|
+
# 145 M-^Q
|
294
|
+
:ed_unassigned,
|
295
|
+
# 146 M-^R
|
296
|
+
:ed_unassigned,
|
297
|
+
# 147 M-^S
|
298
|
+
:ed_unassigned,
|
299
|
+
# 148 M-^T
|
300
|
+
:ed_unassigned,
|
301
|
+
# 149 M-^U
|
302
|
+
:ed_unassigned,
|
303
|
+
# 150 M-^V
|
304
|
+
:ed_unassigned,
|
305
|
+
# 151 M-^W
|
306
|
+
:ed_unassigned,
|
307
|
+
# 152 M-^X
|
308
|
+
:ed_unassigned,
|
309
|
+
# 153 M-^Y
|
310
|
+
:ed_unassigned,
|
311
|
+
# 154 M-^Z
|
312
|
+
:ed_unassigned,
|
313
|
+
# 155 M-^[
|
314
|
+
:ed_unassigned,
|
315
|
+
# 156 M-^\
|
316
|
+
:ed_unassigned,
|
317
|
+
# 157 M-^]
|
318
|
+
:ed_unassigned,
|
319
|
+
# 158 M-^^
|
320
|
+
:ed_unassigned,
|
321
|
+
# 159 M-^_
|
322
|
+
:ed_unassigned,
|
323
|
+
# 160 M-SPACE
|
324
|
+
:ed_unassigned,
|
325
|
+
# 161 M-!
|
326
|
+
:ed_unassigned,
|
327
|
+
# 162 M-"
|
328
|
+
:ed_unassigned,
|
329
|
+
# 163 M-#
|
330
|
+
:ed_unassigned,
|
331
|
+
# 164 M-$
|
332
|
+
:ed_unassigned,
|
333
|
+
# 165 M-%
|
334
|
+
:ed_unassigned,
|
335
|
+
# 166 M-&
|
336
|
+
:ed_unassigned,
|
337
|
+
# 167 M-'
|
338
|
+
:ed_unassigned,
|
339
|
+
# 168 M-(
|
340
|
+
:ed_unassigned,
|
341
|
+
# 169 M-)
|
342
|
+
:ed_unassigned,
|
343
|
+
# 170 M-*
|
344
|
+
:ed_unassigned,
|
345
|
+
# 171 M-+
|
346
|
+
:ed_unassigned,
|
347
|
+
# 172 M-,
|
348
|
+
:ed_unassigned,
|
349
|
+
# 173 M--
|
350
|
+
:ed_unassigned,
|
351
|
+
# 174 M-.
|
352
|
+
:ed_unassigned,
|
353
|
+
# 175 M-/
|
354
|
+
:ed_unassigned,
|
355
|
+
# 176 M-0
|
356
|
+
:ed_unassigned,
|
357
|
+
# 177 M-1
|
358
|
+
:ed_unassigned,
|
359
|
+
# 178 M-2
|
360
|
+
:ed_unassigned,
|
361
|
+
# 179 M-3
|
362
|
+
:ed_unassigned,
|
363
|
+
# 180 M-4
|
364
|
+
:ed_unassigned,
|
365
|
+
# 181 M-5
|
366
|
+
:ed_unassigned,
|
367
|
+
# 182 M-6
|
368
|
+
:ed_unassigned,
|
369
|
+
# 183 M-7
|
370
|
+
:ed_unassigned,
|
371
|
+
# 184 M-8
|
372
|
+
:ed_unassigned,
|
373
|
+
# 185 M-9
|
374
|
+
:ed_unassigned,
|
375
|
+
# 186 M-:
|
376
|
+
:ed_unassigned,
|
377
|
+
# 187 M-;
|
378
|
+
:ed_unassigned,
|
379
|
+
# 188 M-<
|
380
|
+
:ed_unassigned,
|
381
|
+
# 189 M-=
|
382
|
+
:ed_unassigned,
|
383
|
+
# 190 M->
|
384
|
+
:ed_unassigned,
|
385
|
+
# 191 M-?
|
386
|
+
:ed_unassigned,
|
387
|
+
# 192 M-@
|
388
|
+
:ed_unassigned,
|
389
|
+
# 193 M-A
|
390
|
+
:ed_unassigned,
|
391
|
+
# 194 M-B
|
392
|
+
:ed_unassigned,
|
393
|
+
# 195 M-C
|
394
|
+
:ed_unassigned,
|
395
|
+
# 196 M-D
|
396
|
+
:ed_unassigned,
|
397
|
+
# 197 M-E
|
398
|
+
:ed_unassigned,
|
399
|
+
# 198 M-F
|
400
|
+
:ed_unassigned,
|
401
|
+
# 199 M-G
|
402
|
+
:ed_unassigned,
|
403
|
+
# 200 M-H
|
404
|
+
:ed_unassigned,
|
405
|
+
# 201 M-I
|
406
|
+
:ed_unassigned,
|
407
|
+
# 202 M-J
|
408
|
+
:ed_unassigned,
|
409
|
+
# 203 M-K
|
410
|
+
:ed_unassigned,
|
411
|
+
# 204 M-L
|
412
|
+
:ed_unassigned,
|
413
|
+
# 205 M-M
|
414
|
+
:ed_unassigned,
|
415
|
+
# 206 M-N
|
416
|
+
:ed_unassigned,
|
417
|
+
# 207 M-O
|
418
|
+
:ed_sequence_lead_in,
|
419
|
+
# 208 M-P
|
420
|
+
:ed_unassigned,
|
421
|
+
# 209 M-Q
|
422
|
+
:ed_unassigned,
|
423
|
+
# 210 M-R
|
424
|
+
:ed_unassigned,
|
425
|
+
# 211 M-S
|
426
|
+
:ed_unassigned,
|
427
|
+
# 212 M-T
|
428
|
+
:ed_unassigned,
|
429
|
+
# 213 M-U
|
430
|
+
:ed_unassigned,
|
431
|
+
# 214 M-V
|
432
|
+
:ed_unassigned,
|
433
|
+
# 215 M-W
|
434
|
+
:ed_unassigned,
|
435
|
+
# 216 M-X
|
436
|
+
:ed_unassigned,
|
437
|
+
# 217 M-Y
|
438
|
+
:ed_unassigned,
|
439
|
+
# 218 M-Z
|
440
|
+
:ed_unassigned,
|
441
|
+
# 219 M-[
|
442
|
+
:ed_sequence_lead_in,
|
443
|
+
# 220 M-\
|
444
|
+
:ed_unassigned,
|
445
|
+
# 221 M-]
|
446
|
+
:ed_unassigned,
|
447
|
+
# 222 M-^
|
448
|
+
:ed_unassigned,
|
449
|
+
# 223 M-_
|
450
|
+
:ed_unassigned,
|
451
|
+
# 224 M-`
|
452
|
+
:ed_unassigned,
|
453
|
+
# 225 M-a
|
454
|
+
:ed_unassigned,
|
455
|
+
# 226 M-b
|
456
|
+
:ed_unassigned,
|
457
|
+
# 227 M-c
|
458
|
+
:ed_unassigned,
|
459
|
+
# 228 M-d
|
460
|
+
:ed_unassigned,
|
461
|
+
# 229 M-e
|
462
|
+
:ed_unassigned,
|
463
|
+
# 230 M-f
|
464
|
+
:ed_unassigned,
|
465
|
+
# 231 M-g
|
466
|
+
:ed_unassigned,
|
467
|
+
# 232 M-h
|
468
|
+
:ed_unassigned,
|
469
|
+
# 233 M-i
|
470
|
+
:ed_unassigned,
|
471
|
+
# 234 M-j
|
472
|
+
:ed_unassigned,
|
473
|
+
# 235 M-k
|
474
|
+
:ed_unassigned,
|
475
|
+
# 236 M-l
|
476
|
+
:ed_unassigned,
|
477
|
+
# 237 M-m
|
478
|
+
:ed_unassigned,
|
479
|
+
# 238 M-n
|
480
|
+
:ed_unassigned,
|
481
|
+
# 239 M-o
|
482
|
+
:ed_unassigned,
|
483
|
+
# 240 M-p
|
484
|
+
:ed_unassigned,
|
485
|
+
# 241 M-q
|
486
|
+
:ed_unassigned,
|
487
|
+
# 242 M-r
|
488
|
+
:ed_unassigned,
|
489
|
+
# 243 M-s
|
490
|
+
:ed_unassigned,
|
491
|
+
# 244 M-t
|
492
|
+
:ed_unassigned,
|
493
|
+
# 245 M-u
|
494
|
+
:ed_unassigned,
|
495
|
+
# 246 M-v
|
496
|
+
:ed_unassigned,
|
497
|
+
# 247 M-w
|
498
|
+
:ed_unassigned,
|
499
|
+
# 248 M-x
|
500
|
+
:ed_unassigned,
|
501
|
+
# 249 M-y
|
502
|
+
:ed_unassigned,
|
503
|
+
# 250 M-z
|
504
|
+
:ed_unassigned,
|
505
|
+
# 251 M-{
|
506
|
+
:ed_unassigned,
|
507
|
+
# 252 M-|
|
508
|
+
:ed_unassigned,
|
509
|
+
# 253 M-}
|
510
|
+
:ed_unassigned,
|
511
|
+
# 254 M-~
|
512
|
+
:ed_unassigned,
|
513
|
+
# 255 M-^?
|
514
|
+
:ed_unassigned
|
515
|
+
# EOF
|
516
|
+
]
|
517
|
+
end
|
518
|
+
|