Skip to content

Commit 5a509a1

Browse files
Niloth-pneiljp
authored andcommitted
keys: Re-order editor text manipulation key bindings by importance.
The text manipulation hotkeys are re-ordered to place more powerful commands at the beginning of the category in the help menu and the doc. As part of this process, the editor key bindings are grouped by their categories within the source file, improving readability. Hotkeys document regenerated.
1 parent 92dc44b commit 5a509a1

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

docs/hotkeys.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@
9797
## Editor: Text Manipulation
9898
|Command|Key Combination|
9999
| :--- | :---: |
100-
|Delete previous character (to left)|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
101-
|Transpose characters|<kbd>Ctrl</kbd> + <kbd>t</kbd>|
100+
|Undo last action|<kbd>Ctrl</kbd> + <kbd>_</kbd>|
101+
|Clear text box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|
102102
|Cut forwards to the end of the line|<kbd>Ctrl</kbd> + <kbd>k</kbd>|
103103
|Cut backwards to the start of the line|<kbd>Ctrl</kbd> + <kbd>u</kbd>|
104104
|Cut forwards to the end of the current word|<kbd>Meta</kbd> + <kbd>d</kbd>|
105105
|Cut backwards to the start of the current word|<kbd>Ctrl</kbd> + <kbd>w</kbd> / <kbd>Meta</kbd> + <kbd>Backspace</kbd>|
106106
|Cut the current line|<kbd>Meta</kbd> + <kbd>x</kbd>|
107107
|Paste last cut section|<kbd>Ctrl</kbd> + <kbd>y</kbd>|
108-
|Undo last action|<kbd>Ctrl</kbd> + <kbd>_</kbd>|
109-
|Clear text box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|
108+
|Delete previous character (to left)|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
109+
|Transpose characters|<kbd>Ctrl</kbd> + <kbd>t</kbd>|
110110

zulipterminal/config/keys.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,24 @@ class KeyBinding(TypedDict):
340340
'help_text': 'Jump forward one word',
341341
'key_category': 'editor_navigation',
342342
},
343-
'DELETE_LAST_CHARACTER': {
344-
'keys': ['ctrl h'],
345-
'help_text': 'Delete previous character (to left)',
343+
'PREV_LINE': {
344+
'keys': ['up', 'ctrl p'],
345+
'help_text': 'Jump to the previous line',
346+
'key_category': 'editor_navigation',
347+
},
348+
'NEXT_LINE': {
349+
'keys': ['down', 'ctrl n'],
350+
'help_text': 'Jump to the next line',
351+
'key_category': 'editor_navigation',
352+
},
353+
'UNDO_LAST_ACTION': {
354+
'keys': ['ctrl _'],
355+
'help_text': 'Undo last action',
346356
'key_category': 'editor_text_manipulation',
347357
},
348-
'TRANSPOSE_CHARACTERS': {
349-
'keys': ['ctrl t'],
350-
'help_text': 'Transpose characters',
358+
'CLEAR_MESSAGE': {
359+
'keys': ['ctrl l'],
360+
'help_text': 'Clear text box',
351361
'key_category': 'editor_text_manipulation',
352362
},
353363
'CUT_TO_END_OF_LINE': {
@@ -380,24 +390,14 @@ class KeyBinding(TypedDict):
380390
'help_text': 'Paste last cut section',
381391
'key_category': 'editor_text_manipulation',
382392
},
383-
'UNDO_LAST_ACTION': {
384-
'keys': ['ctrl _'],
385-
'help_text': 'Undo last action',
393+
'DELETE_LAST_CHARACTER': {
394+
'keys': ['ctrl h'],
395+
'help_text': 'Delete previous character (to left)',
386396
'key_category': 'editor_text_manipulation',
387397
},
388-
'PREV_LINE': {
389-
'keys': ['up', 'ctrl p'],
390-
'help_text': 'Jump to the previous line',
391-
'key_category': 'editor_navigation',
392-
},
393-
'NEXT_LINE': {
394-
'keys': ['down', 'ctrl n'],
395-
'help_text': 'Jump to the next line',
396-
'key_category': 'editor_navigation',
397-
},
398-
'CLEAR_MESSAGE': {
399-
'keys': ['ctrl l'],
400-
'help_text': 'Clear text box',
398+
'TRANSPOSE_CHARACTERS': {
399+
'keys': ['ctrl t'],
400+
'help_text': 'Transpose characters',
401401
'key_category': 'editor_text_manipulation',
402402
},
403403
'FULL_RENDERED_MESSAGE': {

0 commit comments

Comments
 (0)