Skip to content

Commit d68c05f

Browse files
Niloth-pneiljp
authored andcommitted
keys: Add missing key combinations provided by urwid-readline.
Updated key bindings to include undocumented key combinations that are provided by urwid_readline. For reference see: https://github.com/rr-/urwid_readline/blob/master/urwid_readline/readline_edit.py#L88 All undocumented hotkeys and commands provided by urwid_readline are now present, except for: - delete and backspace keys, as they're fairly obvious in modern systems - Ctrl + d hotkey for character deletion (same as delete key) - currently used for sending messages from the compose box - Ctrl + b/f hotkeys for stepping backwards/forwards by one character - Ctrl + f is currently used for autocomplete from the compose box Hotkeys document regenerated.
1 parent 176067f commit d68c05f

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

docs/hotkeys.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@
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-
|Jump to the beginning of line|<kbd>Ctrl</kbd> + <kbd>a</kbd>|
87-
|Jump to the end of line|<kbd>Ctrl</kbd> + <kbd>e</kbd>|
88-
|Jump backward one word|<kbd>Meta</kbd> + <kbd>b</kbd>|
89-
|Jump forward one word|<kbd>Meta</kbd> + <kbd>f</kbd>|
86+
|Jump to the beginning of line|<kbd>Ctrl</kbd> + <kbd>a</kbd> / <kbd>Home</kbd>|
87+
|Jump to the end of line|<kbd>Ctrl</kbd> + <kbd>e</kbd> / <kbd>End</kbd>|
88+
|Jump backward one word|<kbd>Meta</kbd> + <kbd>b</kbd> / <kbd>Shift</kbd> + <kbd>Left</kbd>|
89+
|Jump forward one word|<kbd>Meta</kbd> + <kbd>f</kbd> / <kbd>Shift</kbd> + <kbd>Right</kbd>|
9090
|Delete previous character (to left)|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
9191
|Transpose characters|<kbd>Ctrl</kbd> + <kbd>t</kbd>|
9292
|Cut forwards to the end of the line|<kbd>Ctrl</kbd> + <kbd>k</kbd>|
9393
|Cut backwards to the start of the line|<kbd>Ctrl</kbd> + <kbd>u</kbd>|
9494
|Cut forwards to the end of the current word|<kbd>Meta</kbd> + <kbd>d</kbd>|
95-
|Cut backwards to the start of the current word|<kbd>Ctrl</kbd> + <kbd>w</kbd>|
95+
|Cut backwards to the start of the current word|<kbd>Ctrl</kbd> + <kbd>w</kbd> / <kbd>Meta</kbd> + <kbd>Backspace</kbd>|
96+
|Cut the current line|<kbd>Meta</kbd> + <kbd>x</kbd>|
9697
|Paste last cut section|<kbd>Ctrl</kbd> + <kbd>y</kbd>|
9798
|Undo last action|<kbd>Ctrl</kbd> + <kbd>_</kbd>|
9899
|Jump to the previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|

zulipterminal/config/keys.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,22 +321,22 @@ class KeyBinding(TypedDict):
321321
'key_category': 'general',
322322
},
323323
'BEGINNING_OF_LINE': {
324-
'keys': ['ctrl a'],
324+
'keys': ['ctrl a', 'home'],
325325
'help_text': 'Jump to the beginning of line',
326326
'key_category': 'msg_compose',
327327
},
328328
'END_OF_LINE': {
329-
'keys': ['ctrl e'],
329+
'keys': ['ctrl e', 'end'],
330330
'help_text': 'Jump to the end of line',
331331
'key_category': 'msg_compose',
332332
},
333333
'ONE_WORD_BACKWARD': {
334-
'keys': ['meta b'],
334+
'keys': ['meta b', 'shift left'],
335335
'help_text': 'Jump backward one word',
336336
'key_category': 'msg_compose',
337337
},
338338
'ONE_WORD_FORWARD': {
339-
'keys': ['meta f'],
339+
'keys': ['meta f', 'shift right'],
340340
'help_text': 'Jump forward one word',
341341
'key_category': 'msg_compose',
342342
},
@@ -366,10 +366,15 @@ class KeyBinding(TypedDict):
366366
'key_category': 'msg_compose',
367367
},
368368
'CUT_TO_START_OF_WORD': {
369-
'keys': ['ctrl w'],
369+
'keys': ['ctrl w', 'meta backspace'],
370370
'help_text': 'Cut backwards to the start of the current word',
371371
'key_category': 'msg_compose',
372372
},
373+
'CUT_WHOLE_LINE': {
374+
'keys': ['meta x'],
375+
'help_text': 'Cut the current line',
376+
'key_category': 'msg_compose',
377+
},
373378
'PASTE_LAST_CUT': {
374379
'keys': ['ctrl y'],
375380
'help_text': 'Paste last cut section',

0 commit comments

Comments
 (0)