Skip to content

Commit 92dc44b

Browse files
Niloth-pneiljp
authored andcommitted
keys: Extract editor hotkeys into two new categories.
Now that all editors support readline shortcuts after e32ae3e, they've been moved from the message compose category and grouped into 2 new 'editor' sub-categories: - navigation - text manipulation Hotkeys document regenerated.
1 parent d68c05f commit 92dc44b

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

docs/hotkeys.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,20 @@
8383
|Autocomplete @mentions, #stream_names, :emoji: and topics|<kbd>Ctrl</kbd> + <kbd>f</kbd>|
8484
|Cycle through autocomplete suggestions in reverse|<kbd>Ctrl</kbd> + <kbd>r</kbd>|
8585
|Narrow to compose box message recipient|<kbd>Meta</kbd> + <kbd>.</kbd>|
86+
87+
## Editor: Navigation
88+
|Command|Key Combination|
89+
| :--- | :---: |
8690
|Jump to the beginning of line|<kbd>Ctrl</kbd> + <kbd>a</kbd> / <kbd>Home</kbd>|
8791
|Jump to the end of line|<kbd>Ctrl</kbd> + <kbd>e</kbd> / <kbd>End</kbd>|
8892
|Jump backward one word|<kbd>Meta</kbd> + <kbd>b</kbd> / <kbd>Shift</kbd> + <kbd>Left</kbd>|
8993
|Jump forward one word|<kbd>Meta</kbd> + <kbd>f</kbd> / <kbd>Shift</kbd> + <kbd>Right</kbd>|
94+
|Jump to the previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|
95+
|Jump to the next line|<kbd>Down</kbd> / <kbd>Ctrl</kbd> + <kbd>n</kbd>|
96+
97+
## Editor: Text Manipulation
98+
|Command|Key Combination|
99+
| :--- | :---: |
90100
|Delete previous character (to left)|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
91101
|Transpose characters|<kbd>Ctrl</kbd> + <kbd>t</kbd>|
92102
|Cut forwards to the end of the line|<kbd>Ctrl</kbd> + <kbd>k</kbd>|
@@ -96,7 +106,5 @@
96106
|Cut the current line|<kbd>Meta</kbd> + <kbd>x</kbd>|
97107
|Paste last cut section|<kbd>Ctrl</kbd> + <kbd>y</kbd>|
98108
|Undo last action|<kbd>Ctrl</kbd> + <kbd>_</kbd>|
99-
|Jump to the previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|
100-
|Jump to the next line|<kbd>Down</kbd> / <kbd>Ctrl</kbd> + <kbd>n</kbd>|
101-
|Clear compose box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|
109+
|Clear text box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|
102110

zulipterminal/config/keys.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -323,82 +323,82 @@ class KeyBinding(TypedDict):
323323
'BEGINNING_OF_LINE': {
324324
'keys': ['ctrl a', 'home'],
325325
'help_text': 'Jump to the beginning of line',
326-
'key_category': 'msg_compose',
326+
'key_category': 'editor_navigation',
327327
},
328328
'END_OF_LINE': {
329329
'keys': ['ctrl e', 'end'],
330330
'help_text': 'Jump to the end of line',
331-
'key_category': 'msg_compose',
331+
'key_category': 'editor_navigation',
332332
},
333333
'ONE_WORD_BACKWARD': {
334334
'keys': ['meta b', 'shift left'],
335335
'help_text': 'Jump backward one word',
336-
'key_category': 'msg_compose',
336+
'key_category': 'editor_navigation',
337337
},
338338
'ONE_WORD_FORWARD': {
339339
'keys': ['meta f', 'shift right'],
340340
'help_text': 'Jump forward one word',
341-
'key_category': 'msg_compose',
341+
'key_category': 'editor_navigation',
342342
},
343343
'DELETE_LAST_CHARACTER': {
344344
'keys': ['ctrl h'],
345345
'help_text': 'Delete previous character (to left)',
346-
'key_category': 'msg_compose',
346+
'key_category': 'editor_text_manipulation',
347347
},
348348
'TRANSPOSE_CHARACTERS': {
349349
'keys': ['ctrl t'],
350350
'help_text': 'Transpose characters',
351-
'key_category': 'msg_compose',
351+
'key_category': 'editor_text_manipulation',
352352
},
353353
'CUT_TO_END_OF_LINE': {
354354
'keys': ['ctrl k'],
355355
'help_text': 'Cut forwards to the end of the line',
356-
'key_category': 'msg_compose',
356+
'key_category': 'editor_text_manipulation',
357357
},
358358
'CUT_TO_START_OF_LINE': {
359359
'keys': ['ctrl u'],
360360
'help_text': 'Cut backwards to the start of the line',
361-
'key_category': 'msg_compose',
361+
'key_category': 'editor_text_manipulation',
362362
},
363363
'CUT_TO_END_OF_WORD': {
364364
'keys': ['meta d'],
365365
'help_text': 'Cut forwards to the end of the current word',
366-
'key_category': 'msg_compose',
366+
'key_category': 'editor_text_manipulation',
367367
},
368368
'CUT_TO_START_OF_WORD': {
369369
'keys': ['ctrl w', 'meta backspace'],
370370
'help_text': 'Cut backwards to the start of the current word',
371-
'key_category': 'msg_compose',
371+
'key_category': 'editor_text_manipulation',
372372
},
373373
'CUT_WHOLE_LINE': {
374374
'keys': ['meta x'],
375375
'help_text': 'Cut the current line',
376-
'key_category': 'msg_compose',
376+
'key_category': 'editor_text_manipulation',
377377
},
378378
'PASTE_LAST_CUT': {
379379
'keys': ['ctrl y'],
380380
'help_text': 'Paste last cut section',
381-
'key_category': 'msg_compose',
381+
'key_category': 'editor_text_manipulation',
382382
},
383383
'UNDO_LAST_ACTION': {
384384
'keys': ['ctrl _'],
385385
'help_text': 'Undo last action',
386-
'key_category': 'msg_compose',
386+
'key_category': 'editor_text_manipulation',
387387
},
388388
'PREV_LINE': {
389389
'keys': ['up', 'ctrl p'],
390390
'help_text': 'Jump to the previous line',
391-
'key_category': 'msg_compose',
391+
'key_category': 'editor_navigation',
392392
},
393393
'NEXT_LINE': {
394394
'keys': ['down', 'ctrl n'],
395395
'help_text': 'Jump to the next line',
396-
'key_category': 'msg_compose',
396+
'key_category': 'editor_navigation',
397397
},
398398
'CLEAR_MESSAGE': {
399399
'keys': ['ctrl l'],
400-
'help_text': 'Clear compose box',
401-
'key_category': 'msg_compose',
400+
'help_text': 'Clear text box',
401+
'key_category': 'editor_text_manipulation',
402402
},
403403
'FULL_RENDERED_MESSAGE': {
404404
'keys': ['f'],
@@ -420,6 +420,8 @@ class KeyBinding(TypedDict):
420420
"msg_actions": "Message actions",
421421
"stream_list": "Stream list actions",
422422
"msg_compose": "Composing a Message",
423+
"editor_navigation": "Editor: Navigation",
424+
"editor_text_manipulation": "Editor: Text Manipulation",
423425
}
424426

425427
ZT_TO_URWID_CMD_MAPPING = {

0 commit comments

Comments
 (0)