|
17 | 17 | )
|
18 | 18 |
|
19 | 19 |
|
| 20 | +READLINE_SUFFIX = "_READLINE" |
| 21 | + |
| 22 | + |
20 | 23 | class KeyBinding(TypedDict):
|
21 | 24 | keys: List[str]
|
22 | 25 | help_text: str
|
@@ -320,82 +323,82 @@ class KeyBinding(TypedDict):
|
320 | 323 | 'help_text': 'Show/hide user information (from users list)',
|
321 | 324 | 'key_category': 'general',
|
322 | 325 | },
|
323 |
| - 'BEGINNING_OF_LINE': { |
| 326 | + 'BEGINNING_OF_LINE' + READLINE_SUFFIX: { |
324 | 327 | 'keys': ['ctrl a', 'home'],
|
325 | 328 | 'help_text': 'Start of line',
|
326 | 329 | 'key_category': 'editor_navigation',
|
327 | 330 | },
|
328 |
| - 'END_OF_LINE': { |
| 331 | + 'END_OF_LINE' + READLINE_SUFFIX: { |
329 | 332 | 'keys': ['ctrl e', 'end'],
|
330 | 333 | 'help_text': 'End of line',
|
331 | 334 | 'key_category': 'editor_navigation',
|
332 | 335 | },
|
333 |
| - 'ONE_WORD_BACKWARD': { |
| 336 | + 'ONE_WORD_BACKWARD' + READLINE_SUFFIX: { |
334 | 337 | 'keys': ['meta b', 'shift left'],
|
335 | 338 | 'help_text': 'Start of current or previous word',
|
336 | 339 | 'key_category': 'editor_navigation',
|
337 | 340 | },
|
338 |
| - 'ONE_WORD_FORWARD': { |
| 341 | + 'ONE_WORD_FORWARD' + READLINE_SUFFIX: { |
339 | 342 | 'keys': ['meta f', 'shift right'],
|
340 | 343 | 'help_text': 'Start of next word',
|
341 | 344 | 'key_category': 'editor_navigation',
|
342 | 345 | },
|
343 |
| - 'PREV_LINE': { |
| 346 | + 'PREV_LINE' + READLINE_SUFFIX: { |
344 | 347 | 'keys': ['up', 'ctrl p'],
|
345 | 348 | 'help_text': 'Previous line',
|
346 | 349 | 'key_category': 'editor_navigation',
|
347 | 350 | },
|
348 |
| - 'NEXT_LINE': { |
| 351 | + 'NEXT_LINE' + READLINE_SUFFIX: { |
349 | 352 | 'keys': ['down', 'ctrl n'],
|
350 | 353 | 'help_text': 'Next line',
|
351 | 354 | 'key_category': 'editor_navigation',
|
352 | 355 | },
|
353 |
| - 'UNDO_LAST_ACTION': { |
| 356 | + 'UNDO_LAST_ACTION' + READLINE_SUFFIX: { |
354 | 357 | 'keys': ['ctrl _'],
|
355 | 358 | 'help_text': 'Undo last action',
|
356 | 359 | 'key_category': 'editor_text_manipulation',
|
357 | 360 | },
|
358 |
| - 'CLEAR_MESSAGE': { |
| 361 | + 'CLEAR_MESSAGE' + READLINE_SUFFIX: { |
359 | 362 | 'keys': ['ctrl l'],
|
360 | 363 | 'help_text': 'Clear text box',
|
361 | 364 | 'key_category': 'editor_text_manipulation',
|
362 | 365 | },
|
363 |
| - 'CUT_TO_END_OF_LINE': { |
| 366 | + 'CUT_TO_END_OF_LINE' + READLINE_SUFFIX: { |
364 | 367 | 'keys': ['ctrl k'],
|
365 | 368 | 'help_text': 'Cut forwards to the end of the line',
|
366 | 369 | 'key_category': 'editor_text_manipulation',
|
367 | 370 | },
|
368 |
| - 'CUT_TO_START_OF_LINE': { |
| 371 | + 'CUT_TO_START_OF_LINE' + READLINE_SUFFIX: { |
369 | 372 | 'keys': ['ctrl u'],
|
370 | 373 | 'help_text': 'Cut backwards to the start of the line',
|
371 | 374 | 'key_category': 'editor_text_manipulation',
|
372 | 375 | },
|
373 |
| - 'CUT_TO_END_OF_WORD': { |
| 376 | + 'CUT_TO_END_OF_WORD' + READLINE_SUFFIX: { |
374 | 377 | 'keys': ['meta d'],
|
375 | 378 | 'help_text': 'Cut forwards to the end of the current word',
|
376 | 379 | 'key_category': 'editor_text_manipulation',
|
377 | 380 | },
|
378 |
| - 'CUT_TO_START_OF_WORD': { |
| 381 | + 'CUT_TO_START_OF_WORD' + READLINE_SUFFIX: { |
379 | 382 | 'keys': ['ctrl w', 'meta backspace'],
|
380 | 383 | 'help_text': 'Cut backwards to the start of the current word',
|
381 | 384 | 'key_category': 'editor_text_manipulation',
|
382 | 385 | },
|
383 |
| - 'CUT_WHOLE_LINE': { |
| 386 | + 'CUT_WHOLE_LINE' + READLINE_SUFFIX: { |
384 | 387 | 'keys': ['meta x'],
|
385 | 388 | 'help_text': 'Cut the current line',
|
386 | 389 | 'key_category': 'editor_text_manipulation',
|
387 | 390 | },
|
388 |
| - 'PASTE_LAST_CUT': { |
| 391 | + 'PASTE_LAST_CUT' + READLINE_SUFFIX: { |
389 | 392 | 'keys': ['ctrl y'],
|
390 | 393 | 'help_text': 'Paste last cut section',
|
391 | 394 | 'key_category': 'editor_text_manipulation',
|
392 | 395 | },
|
393 |
| - 'DELETE_LAST_CHARACTER': { |
| 396 | + 'DELETE_LAST_CHARACTER' + READLINE_SUFFIX: { |
394 | 397 | 'keys': ['ctrl h'],
|
395 | 398 | 'help_text': 'Delete previous character',
|
396 | 399 | 'key_category': 'editor_text_manipulation',
|
397 | 400 | },
|
398 |
| - 'TRANSPOSE_CHARACTERS': { |
| 401 | + 'TRANSPOSE_CHARACTERS' + READLINE_SUFFIX: { |
399 | 402 | 'keys': ['ctrl t'],
|
400 | 403 | 'help_text': 'Swap with previous character',
|
401 | 404 | 'key_category': 'editor_text_manipulation',
|
|
0 commit comments