on master help sign in
book: Refer to keys by key names, not representations

This is an attempt to clean up the inconsistent way that keys are written in various places. These rules require the fewest changes to the existing text. Use the "Key name", as defined in remapping.md, which uses "Some-Modifiers-PascalCaseKey". The "Representation", which uses "S-M-lowercasekey", is only used for configuration entries. For key combinations which do not present a popup, just present the keys one after the other, with no intervening space, like `]p`. For key combinations which present a popup, separate them with ` + `, like `Space + f`. The Ctrl modifier is called Ctrl, not Control.

commit425df93fb88ecfd0f87025705de348051cd40ccf authorTim Siegel <siegeltr@gmail.com> dateMon 10 Oct 2022, 14:32 (4 years ago) parente542f2e
4 files changed+18−18
book/src/keymap.md+6−6 book/src/remapping.md+4−4 book/src/themes.md+2−2 book/src/usage.md+6−6
book/src/keymap.md+6−6
@@ -129,7 +129,7 @@
129129| `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` |
130130| `Alt-x` | Shrink selection to line bounds (line-wise selection) | `shrink_to_line_bounds` |
131131| `J` | Join lines inside selection | `join_selections` |
132−| `A-J` | Join lines inside selection and select space | `join_selections_space` |
132+| `Alt-J` | Join lines inside selection and select space | `join_selections_space` |
133133| `K` | Keep selections matching the regex | `keep_selections` |
134134| `Alt-K` | Remove selections matching the regex | `remove_selections` |
135135| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
@@ -278,7 +278,7 @@ This layer is a kludge of mappings, mostly pickers.
278278| `/` | Global search in workspace folder | `global_search` |
279279| `?` | Open command palette | `command_palette` |
280280
281−> TIP: Global search displays results in a fuzzy picker, use `space + '` to bring it back up after opening a file.
281+> TIP: Global search displays results in a fuzzy picker, use `Space + '` to bring it back up after opening a file.
282282
283283##### Popup
284284
@@ -311,8 +311,8 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire
311311| `]t` | Go to previous test (**TS**) | `goto_prev_test` |
312312| `]p` | Go to next paragraph | `goto_next_paragraph` |
313313| `[p` | Go to previous paragraph | `goto_prev_paragraph` |
314−| `[space` | Add newline above | `add_newline_above` |
315−| `]space` | Add newline below | `add_newline_below` |
314+| `[Space` | Add newline above | `add_newline_above` |
315+| `]Space` | Add newline below | `add_newline_below` |
316316
317317## Insert mode
318318
@@ -414,8 +414,8 @@ Keys to use within prompt, Remapping currently not supported.
414414| `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word |
415415| `Ctrl-u` | Delete to start of line |
416416| `Ctrl-k` | Delete to end of line |
417−| `backspace`, `Ctrl-h` | Delete previous char |
418−| `delete`, `Ctrl-d` | Delete next char |
417+| `Backspace`, `Ctrl-h` | Delete previous char |
418+| `Delete`, `Ctrl-d` | Delete next char |
419419| `Ctrl-s` | Insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later |
420420| `Ctrl-p`, `Up` | Select previous history |
421421| `Ctrl-n`, `Down` | Select next history |
book/src/remapping.md+4−4
@@ -11,11 +11,11 @@ this:
1111```toml
1212# At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'
1313[keys.normal]
14−C-s = ":w" # Maps the Control-s to the typable command :w which is an alias for :write (save file)
15−C-o = ":open ~/.config/helix/config.toml" # Maps the Control-o to opening of the helix config file
14+C-s = ":w" # Maps the Ctrl-s to the typable command :w which is an alias for :write (save file)
15+C-o = ":open ~/.config/helix/config.toml" # Maps the Ctrl-o to opening of the helix config file
1616a = "move_char_left" # Maps the 'a' key to the move_char_left command
1717w = "move_line_up" # Maps the 'w' key move_line_up
18−"C-S-esc" = "extend_line" # Maps Control-Shift-Escape to extend_line
18+"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line
1919g = { a = "code_action" } # Maps `ga` to show possible code actions
2020"ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode
2121
@@ -25,7 +25,7 @@ j = { k = "normal_mode" } # Maps `jk` to exit insert mode
2525```
2626> NOTE: Typable commands can also be remapped, remember to keep the `:` prefix to indicate it's a typable command.
2727
28−Control, Shift and Alt modifiers are encoded respectively with the prefixes
28+Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes
2929`C-`, `S-` and `A-`. Special keys are encoded as follows:
3030
3131| Key name | Representation |
book/src/themes.md+2−2
@@ -244,7 +244,7 @@ These scopes are used for theming the editor interface.
244244| `ui.statusline.insert` | Statusline mode during insert mode ([only if `editor.color-modes` is enabled][editor-section]) |
245245| `ui.statusline.select` | Statusline mode during select mode ([only if `editor.color-modes` is enabled][editor-section]) |
246246| `ui.statusline.separator` | Separator character in statusline |
247−| `ui.popup` | Documentation popups (e.g space-k) |
247+| `ui.popup` | Documentation popups (e.g Space + k) |
248248| `ui.popup.info` | Prompt for multiple key options |
249249| `ui.window` | Border lines separating splits |
250250| `ui.help` | Description box for commands |
@@ -252,7 +252,7 @@ These scopes are used for theming the editor interface.
252252| `ui.text.focus` | |
253253| `ui.text.info` | The key: command text in `ui.popup.info` boxes |
254254| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][editor-section]) |
255−| `ui.virtual.whitespace` | Visible white-space characters |
255+| `ui.virtual.whitespace` | Visible whitespace characters |
256256| `ui.virtual.indent-guide` | Vertical indent width guides |
257257| `ui.menu` | Code and command completion menus |
258258| `ui.menu.selected` | Selected autocomplete item |
book/src/usage.md+6−6
@@ -53,7 +53,7 @@ Multiple characters are currently not supported, but planned.
5353
5454## Syntax-tree Motions
5555
56−`A-p`, `A-o`, `A-i`, and `A-n` (or `Alt` and arrow keys) move the primary
56+`Alt-p`, `Alt-o`, `Alt-i`, and `Alt-n` (or `Alt` and arrow keys) move the primary
5757selection according to the selection's place in the syntax tree. Let's walk
5858through an example to get familiar with them. Many languages have a syntax like
5959so for function calls:
@@ -100,13 +100,13 @@ in the tree above.
100100func([arg1], arg2, arg3)
101101```
102102
103−Using `A-n` would select the next sibling in the syntax tree: `arg2`.
103+Using `Alt-n` would select the next sibling in the syntax tree: `arg2`.
104104
105105```
106106func(arg1, [arg2], arg3)
107107```
108108
109−While `A-o` would expand the selection to the parent node. In the tree above we
109+While `Alt-o` would expand the selection to the parent node. In the tree above we
110110can see that we would select the `arguments` node.
111111
112112```
@@ -114,10 +114,10 @@ func[(arg1, arg2, arg3)]
114114```
115115
116116There is also some nuanced behavior that prevents you from getting stuck on a
117−node with no sibling. If we have a selection on `arg1`, `A-p` would bring us
117+node with no sibling. If we have a selection on `arg1`, `Alt-p` would bring us
118118to the previous child node. Since `arg1` doesn't have a sibling to its left,
119−though, we climb the syntax tree and then take the previous selection. So `A-p`
120−will move the selection over to the "func" `identifier`.
119+though, we climb the syntax tree and then take the previous selection. So
120+`Alt-p` will move the selection over to the "func" `identifier`.
121121
122122```
123123[func](arg1, arg2, arg3)