Skip to content

Commit

Permalink
keys/docs: Make editor actions a help category.
Browse files Browse the repository at this point in the history
Now that all editors support readline shortcuts,
they've been grouped into their own category.
  • Loading branch information
Niloth-p committed May 9, 2024
1 parent e32ae3e commit 16dbd30
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
10 changes: 7 additions & 3 deletions docs/hotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@
|Autocomplete @mentions, #stream_names, :emoji: and topics|<kbd>Ctrl</kbd> + <kbd>f</kbd>|
|Cycle through autocomplete suggestions in reverse|<kbd>Ctrl</kbd> + <kbd>r</kbd>|
|Narrow to compose box message recipient|<kbd>Meta</kbd> + <kbd>.</kbd>|
|Jump to the previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|
|Jump to the next line|<kbd>Down</kbd> / <kbd>Ctrl</kbd> + <kbd>n</kbd>|
|Clear compose box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|

## Editor actions
|Command|Key Combination|
| :--- | :---: |
|Jump to the beginning of line|<kbd>Ctrl</kbd> + <kbd>a</kbd>|
|Jump to the end of line|<kbd>Ctrl</kbd> + <kbd>e</kbd>|
|Jump backward one word|<kbd>Meta</kbd> + <kbd>b</kbd>|
Expand All @@ -95,7 +102,4 @@
|Cut backwards to the start of the current word|<kbd>Ctrl</kbd> + <kbd>w</kbd>|
|Paste last cut section|<kbd>Ctrl</kbd> + <kbd>y</kbd>|
|Undo last action|<kbd>Ctrl</kbd> + <kbd>_</kbd>|
|Jump to the previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|
|Jump to the next line|<kbd>Down</kbd> / <kbd>Ctrl</kbd> + <kbd>n</kbd>|
|Clear compose box|<kbd>Ctrl</kbd> + <kbd>l</kbd>|

31 changes: 16 additions & 15 deletions zulipterminal/config/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,77 +323,77 @@ class KeyBinding(TypedDict):
'BEGINNING_OF_LINE': {
'keys': ['ctrl a'],
'help_text': 'Jump to the beginning of line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'END_OF_LINE': {
'keys': ['ctrl e'],
'help_text': 'Jump to the end of line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'ONE_WORD_BACKWARD': {
'keys': ['meta b'],
'help_text': 'Jump backward one word',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'ONE_WORD_FORWARD': {
'keys': ['meta f'],
'help_text': 'Jump forward one word',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'DELETE_LAST_CHARACTER': {
'keys': ['ctrl h'],
'help_text': 'Delete previous character (to left)',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'TRANSPOSE_CHARACTERS': {
'keys': ['ctrl t'],
'help_text': 'Transpose characters',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'CUT_TO_END_OF_LINE': {
'keys': ['ctrl k'],
'help_text': 'Cut forwards to the end of the line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'CUT_TO_START_OF_LINE': {
'keys': ['ctrl u'],
'help_text': 'Cut backwards to the start of the line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'CUT_TO_END_OF_WORD': {
'keys': ['meta d'],
'help_text': 'Cut forwards to the end of the current word',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'CUT_TO_START_OF_WORD': {
'keys': ['ctrl w'],
'help_text': 'Cut backwards to the start of the current word',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'PASTE_LAST_CUT': {
'keys': ['ctrl y'],
'help_text': 'Paste last cut section',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'UNDO_LAST_ACTION': {
'keys': ['ctrl _'],
'help_text': 'Undo last action',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'PREV_LINE': {
'keys': ['up', 'ctrl p'],
'help_text': 'Jump to the previous line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'NEXT_LINE': {
'keys': ['down', 'ctrl n'],
'help_text': 'Jump to the next line',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'CLEAR_MESSAGE': {
'keys': ['ctrl l'],
'help_text': 'Clear compose box',
'key_category': 'msg_compose',
'key_category': 'editor',
},
'FULL_RENDERED_MESSAGE': {
'keys': ['f'],
Expand All @@ -415,6 +415,7 @@ class KeyBinding(TypedDict):
"msg_actions": "Message actions",
"stream_list": "Stream list actions",
"msg_compose": "Composing a Message",
"editor": "Editor actions",
}

ZT_TO_URWID_CMD_MAPPING = {
Expand Down

0 comments on commit 16dbd30

Please sign in to comment.