Skip to content

Commit

Permalink
keys: Improve descriptions of editor hotkeys.
Browse files Browse the repository at this point in the history
- Remove the common prefix "jump [to]", mentioning the targets directly
  (shortens the length of the help text without a reduction in clarity)
- Use "Start" instead of "Beginning" (consistent with existing uses)
- Clarify that Shift+Left (and equivalent) includes the current word
- Use the simpler "Swap" instead of "Transpose"
- Consistently use "Previous" in descriptions

Hotkeys document regenerated.
  • Loading branch information
Niloth-p authored and neiljp committed Jun 1, 2024
1 parent 12663f0 commit ba0cf98
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions docs/hotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
## Editor: Navigation
|Command|Key Combination|
| :--- | :---: |
|Jump to the beginning of line|<kbd>Ctrl</kbd> + <kbd>a</kbd> / <kbd>Home</kbd>|
|Jump to the end of line|<kbd>Ctrl</kbd> + <kbd>e</kbd> / <kbd>End</kbd>|
|Jump backward one word|<kbd>Meta</kbd> + <kbd>b</kbd> / <kbd>Shift</kbd> + <kbd>Left</kbd>|
|Jump forward one word|<kbd>Meta</kbd> + <kbd>f</kbd> / <kbd>Shift</kbd> + <kbd>Right</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>|
|Start of line|<kbd>Ctrl</kbd> + <kbd>a</kbd> / <kbd>Home</kbd>|
|End of line|<kbd>Ctrl</kbd> + <kbd>e</kbd> / <kbd>End</kbd>|
|Start of current or previous word|<kbd>Meta</kbd> + <kbd>b</kbd> / <kbd>Shift</kbd> + <kbd>Left</kbd>|
|Start of next word|<kbd>Meta</kbd> + <kbd>f</kbd> / <kbd>Shift</kbd> + <kbd>Right</kbd>|
|Previous line|<kbd>Up</kbd> / <kbd>Ctrl</kbd> + <kbd>p</kbd>|
|Next line|<kbd>Down</kbd> / <kbd>Ctrl</kbd> + <kbd>n</kbd>|

## Editor: Text Manipulation
|Command|Key Combination|
Expand All @@ -105,6 +105,6 @@
|Cut backwards to the start of the current word|<kbd>Ctrl</kbd> + <kbd>w</kbd> / <kbd>Meta</kbd> + <kbd>Backspace</kbd>|
|Cut the current line|<kbd>Meta</kbd> + <kbd>x</kbd>|
|Paste last cut section|<kbd>Ctrl</kbd> + <kbd>y</kbd>|
|Delete previous character (to left)|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
|Transpose characters|<kbd>Ctrl</kbd> + <kbd>t</kbd>|
|Delete previous character|<kbd>Ctrl</kbd> + <kbd>h</kbd>|
|Swap with previous character|<kbd>Ctrl</kbd> + <kbd>t</kbd>|

16 changes: 8 additions & 8 deletions zulipterminal/config/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,32 +322,32 @@ class KeyBinding(TypedDict):
},
'BEGINNING_OF_LINE': {
'keys': ['ctrl a', 'home'],
'help_text': 'Jump to the beginning of line',
'help_text': 'Start of line',
'key_category': 'editor_navigation',
},
'END_OF_LINE': {
'keys': ['ctrl e', 'end'],
'help_text': 'Jump to the end of line',
'help_text': 'End of line',
'key_category': 'editor_navigation',
},
'ONE_WORD_BACKWARD': {
'keys': ['meta b', 'shift left'],
'help_text': 'Jump backward one word',
'help_text': 'Start of current or previous word',
'key_category': 'editor_navigation',
},
'ONE_WORD_FORWARD': {
'keys': ['meta f', 'shift right'],
'help_text': 'Jump forward one word',
'help_text': 'Start of next word',
'key_category': 'editor_navigation',
},
'PREV_LINE': {
'keys': ['up', 'ctrl p'],
'help_text': 'Jump to the previous line',
'help_text': 'Previous line',
'key_category': 'editor_navigation',
},
'NEXT_LINE': {
'keys': ['down', 'ctrl n'],
'help_text': 'Jump to the next line',
'help_text': 'Next line',
'key_category': 'editor_navigation',
},
'UNDO_LAST_ACTION': {
Expand Down Expand Up @@ -392,12 +392,12 @@ class KeyBinding(TypedDict):
},
'DELETE_LAST_CHARACTER': {
'keys': ['ctrl h'],
'help_text': 'Delete previous character (to left)',
'help_text': 'Delete previous character',
'key_category': 'editor_text_manipulation',
},
'TRANSPOSE_CHARACTERS': {
'keys': ['ctrl t'],
'help_text': 'Transpose characters',
'help_text': 'Swap with previous character',
'key_category': 'editor_text_manipulation',
},
'FULL_RENDERED_MESSAGE': {
Expand Down

0 comments on commit ba0cf98

Please sign in to comment.