diff options
Diffstat (limited to 'book/src')
-rw-r--r-- | book/src/configuration.md | 38 | ||||
-rw-r--r-- | book/src/generated/lang-support.md | 5 | ||||
-rw-r--r-- | book/src/generated/typable-cmd.md | 2 | ||||
-rw-r--r-- | book/src/guides/indent.md | 14 | ||||
-rw-r--r-- | book/src/install.md | 34 | ||||
-rw-r--r-- | book/src/keymap.md | 118 | ||||
-rw-r--r-- | book/src/remapping.md | 8 | ||||
-rw-r--r-- | book/src/themes.md | 105 | ||||
-rw-r--r-- | book/src/usage.md | 12 |
9 files changed, 210 insertions, 126 deletions
diff --git a/book/src/configuration.md b/book/src/configuration.md index fdabe768..996c5fb6 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -28,19 +28,24 @@ hidden = false You may also specify a file to use for configuration with the `-c` or `--config` CLI argument: `hx -c path/to/custom-config.toml`. +It is also possible to trigger configuration file reloading by sending the `USR1` +signal to the helix process, e.g. via `pkill -USR1 hx`. This is only supported +on unix operating systems. + ## Editor ### `[editor]` Section | Key | Description | Default | |--|--|---------| -| `scrolloff` | Number of lines of padding around the edge of the screen when scrolling. | `3` | +| `scrolloff` | Number of lines of padding around the edge of the screen when scrolling. | `5` | | `mouse` | Enable mouse mode. | `true` | | `middle-click-paste` | Middle click paste support. | `true` | | `scroll-lines` | Number of lines to scroll per scroll wheel step. | `3` | | `shell` | Shell to use when running external commands. | Unix: `["sh", "-c"]`<br/>Windows: `["cmd", "/C"]` | | `line-number` | Line number display: `absolute` simply shows each line's number, while `relative` shows the distance from the current line. When unfocused or in insert mode, `relative` will still show absolute line numbers. | `absolute` | | `cursorline` | Highlight all lines with a cursor. | `false` | +| `cursorcolumn` | Highlight all columns with a cursor. | `false` | | `gutters` | Gutters to display: Available are `diagnostics` and `line-numbers` and `spacer`, note that `diagnostics` also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | `["diagnostics", "line-numbers"]` | | `auto-completion` | Enable automatic pop up of auto-completion. | `true` | | `auto-format` | Enable automatic formatting on save. | `true` | @@ -68,17 +73,32 @@ left = ["mode", "spinner"] center = ["file-name"] right = ["diagnostics", "selections", "position", "file-encoding", "file-line-ending", "file-type"] separator = "│" +mode.normal = "NORMAL" +mode.insert = "INSERT" +mode.select = "SELECT" ``` +The `[editor.statusline]` key takes the following sub-keys: + +| Key | Description | Default | +| --- | --- | --- | +| `left` | A list of elements aligned to the left of the statusline | `["mode", "spinner", "file-name"]` | +| `center` | A list of elements aligned to the middle of the statusline | `[]` | +| `right` | A list of elements aligned to the right of the statusline | `["diagnostics", "selections", "position", "file-encoding"]` | +| `separator` | The character used to separate elements in the statusline | `"│"` | +| `mode.normal` | The text shown in the `mode` element for normal mode | `"NOR"` | +| `mode.insert` | The text shown in the `mode` element for insert mode | `"INS"` | +| `mode.select` | The text shown in the `mode` element for select mode | `"SEL"` | -The following elements can be configured: +The following statusline elements can be configured: | Key | Description | | ------ | ----------- | -| `mode` | The current editor mode (`NOR`/`INS`/`SEL`) | +| `mode` | The current editor mode (`mode.normal`/`mode.insert`/`mode.select`) | | `spinner` | A progress spinner indicating LSP activity | | `file-name` | The path/name of the opened file | | `file-encoding` | The encoding of the opened file if it differs from UTF-8 | | `file-line-ending` | The file line endings (CRLF or LF) | +| `total-line-numbers` | The total line numbers of the opened file | | `file-type` | The type of the opened file | | `diagnostics` | The number of warnings and/or errors | | `selections` | The number of active selections | @@ -218,15 +238,17 @@ tabpad = "·" # Tabs will look like "→···" (depending on tab width) Options for rendering vertical indent guides. -| Key | Description | Default | -| --- | --- | --- | -| `render` | Whether to render indent guides. | `false` | -| `character` | Literal character to use for rendering the indent guide | `│` | +| Key | Description | Default | +| --- | --- | --- | +| `render` | Whether to render indent guides. | `false` | +| `character` | Literal character to use for rendering the indent guide | `│` | +| `skip-levels` | Number of indent levels to skip | `0` | Example: ```toml [editor.indent-guides] render = true -character = "╎" +character = "╎" # Some characters that work well: "▏", "┆", "┊", "⸽" +skip-levels = 1 ``` diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 5c64d097..3fe9ef70 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -66,7 +66,7 @@ | llvm | ✓ | ✓ | ✓ | | | llvm-mir | ✓ | ✓ | ✓ | | | llvm-mir-yaml | ✓ | | ✓ | | -| lua | ✓ | | ✓ | `lua-language-server` | +| lua | ✓ | ✓ | ✓ | `lua-language-server` | | make | ✓ | | | | | markdown | ✓ | | | `marksman` | | markdown.inline | ✓ | | | | @@ -86,7 +86,8 @@ | prisma | ✓ | | | `prisma-language-server` | | prolog | | | | `swipl` | | protobuf | ✓ | | ✓ | | -| python | ✓ | ✓ | | `pylsp` | +| purescript | ✓ | | | `purescript-language-server` | +| python | ✓ | ✓ | ✓ | `pylsp` | | r | ✓ | | | `R` | | racket | | | | `racket` | | regex | ✓ | | | | diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 4cbff306..05a0985b 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -65,7 +65,7 @@ | `:config-reload` | Refresh user config. | | `:config-open` | Open the user config.toml file. | | `:log-open` | Open the helix log file. | -| `:insert-output` | Run shell command, inserting output after each selection. | +| `:insert-output` | Run shell command, inserting output before each selection. | | `:append-output` | Run shell command, appending output after each selection. | | `:pipe` | Pipe each selection to the shell command. | | `:run-shell-command`, `:sh` | Run a shell command | diff --git a/book/src/guides/indent.md b/book/src/guides/indent.md index f4d916b2..0e259289 100644 --- a/book/src/guides/indent.md +++ b/book/src/guides/indent.md @@ -46,6 +46,20 @@ capture on the same line, the indent level isn't changed at all. - `@outdent` (default scope `all`): Decrease the indent level by 1. The same rules as for `@indent` apply. +- `@extend`: +Extend the range of this node to the end of the line and to lines that +are indented more than the line that this node starts on. This is useful +for languages like Python, where for the purpose of indentation some nodes +(like functions or classes) should also contain indented lines that follow them. + +- `@extend.prevent-once`: +Prevents the first extension of an ancestor of this node. For example, in Python +a return expression always ends the block that it is in. Note that this only stops the +extension of the next `@extend` capture. If multiple ancestors are captured, +only the extension of the innermost one is prevented. All other ancestors are unaffected +(regardless of whether the innermost ancestor would actually have been extended). + + ## Predicates In some cases, an S-expression cannot express exactly what pattern should be matched. diff --git a/book/src/install.md b/book/src/install.md index d7a51ac2..136e12c9 100644 --- a/book/src/install.md +++ b/book/src/install.md @@ -60,24 +60,40 @@ cargo install --path helix-term This will install the `hx` binary to `$HOME/.cargo/bin`. -Helix also needs it's runtime files so make sure to copy/symlink the `runtime/` directory into the +Helix also needs its runtime files so make sure to copy/symlink the `runtime/` directory into the config directory (for example `~/.config/helix/runtime` on Linux/macOS). This location can be overridden via the `HELIX_RUNTIME` environment variable. -| OS | command | -|-------------------|-----------| -|windows(cmd.exe) |`xcopy /e /i runtime %AppData%/helix/runtime` | -|windows(powershell)|`xcopy /e /i runtime $Env:AppData\helix\runtime` | -|linux/macos |`ln -s $PWD/runtime ~/.config/helix/runtime`| +| OS | command | +| ------------------- | ------------------------------------------------ | +| windows(cmd.exe) | `xcopy /e /i runtime %AppData%/helix/runtime` | +| windows(powershell) | `xcopy /e /i runtime $Env:AppData\helix\runtime` | +| linux/macos | `ln -s $PWD/runtime ~/.config/helix/runtime` | -## Finishing up the installation +To use Helix in desktop environments that supports [XDG desktop menu](https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html), including Gnome and KDE, copy the provided `.desktop` file to the correct folder: + +```bash +cp contrib/Helix.desktop ~/.local/share/applications +``` + +To use another terminal than the default, you will need to modify the `.desktop` file. For example, to use `kitty`: + +```bash +sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop +sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop +``` + +Please note: there is no icon for Helix yet, so the system default will be used. + +## Finishing up the installation + +To make sure everything is set up as expected you should finally run the helix healthcheck via -To make sure everything is set up as expected you should finally run the helix healthcheck via ``` hx --health ``` -For more information on the information displayed in the healthcheck results refer to [Healthcheck](https://github.com/helix-editor/helix/wiki/Healthcheck). +For more information on the information displayed in the health check results refer to [Healthcheck](https://github.com/helix-editor/helix/wiki/Healthcheck). ### Building tree-sitter grammars diff --git a/book/src/keymap.md b/book/src/keymap.md index 6d90d802..6523b09f 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -68,8 +68,8 @@ | `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` | | `i` | Insert before selection | `insert_mode` | | `a` | Insert after selection (append) | `append_mode` | -| `I` | Insert at the start of the line | `prepend_to_line` | -| `A` | Insert at the end of the line | `append_to_line` | +| `I` | Insert at the start of the line | `insert_at_line_start` | +| `A` | Insert at the end of the line | `insert_at_line_end` | | `o` | Open new line below selection | `open_below` | | `O` | Open new line above selection | `open_above` | | `.` | Repeat last insert | N/A | @@ -129,6 +129,7 @@ | `X` | Extend selection to line bounds (line-wise selection) | `extend_to_line_bounds` | | `Alt-x` | Shrink selection to line bounds (line-wise selection) | `shrink_to_line_bounds` | | `J` | Join lines inside selection | `join_selections` | +| `Alt-J` | Join lines inside selection and select space | `join_selections_space` | | `K` | Keep selections matching the regex | `keep_selections` | | `Alt-K` | Remove selections matching the regex | `remove_selections` | | `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` | @@ -166,10 +167,13 @@ These sub-modes are accessible from normal mode and typically switch back to nor #### View mode +Accessed by typing `z` in [normal mode](#normal-mode). + View mode is intended for scrolling and manipulating the view without changing -the selection. The "sticky" variant of this mode is persistent; use the Escape -key to return to normal mode after usage (useful when you're simply looking -over text and not actively editing it). +the selection. The "sticky" variant of this mode (accessed by typing `Z` in +normal mode) is persistent; use the Escape key to return to normal mode after +usage (useful when you're simply looking over text and not actively editing +it). | Key | Description | Command | @@ -187,6 +191,8 @@ over text and not actively editing it). #### Goto mode +Accessed by typing `g` in [normal mode](#normal-mode). + Jumps to various locations. | Key | Description | Command | @@ -212,9 +218,10 @@ Jumps to various locations. #### Match mode -Enter this mode using `m` from normal mode. See the relevant section -in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround) -and [textobject](./usage.md#textobject) usage. +Accessed by typing `m` in [normal mode](#normal-mode). + +See the relevant section in [Usage](./usage.md) for an explanation about +[surround](./usage.md#surround) and [textobject](./usage.md#textobjects) usage. | Key | Description | Command | | ----- | ----------- | ------- | @@ -229,6 +236,8 @@ TODO: Mappings for selecting syntax nodes (a superset of `[`). #### Window mode +Accessed by typing `Ctrl-w` in [normal mode](#normal-mode). + This layer is similar to Vim keybindings as Kakoune does not support window. | Key | Description | Command | @@ -251,8 +260,9 @@ This layer is similar to Vim keybindings as Kakoune does not support window. #### Space mode -This layer is a kludge of mappings, mostly pickers. +Accessed by typing `Space` in [normal mode](#normal-mode). +This layer is a kludge of mappings, mostly pickers. | Key | Description | Command | | ----- | ----------- | ------- | @@ -263,8 +273,8 @@ This layer is a kludge of mappings, mostly pickers. | `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` | | `s` | Open document symbol picker (**LSP**) | `symbol_picker` | | `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` | -| `g` | Open document diagnostics picker (**LSP**) | `diagnostics_picker` | -| `G` | Open workspace diagnostics picker (**LSP**) | `workspace_diagnostics_picker` +| `d` | Open document diagnostics picker (**LSP**) | `diagnostics_picker` | +| `D` | Open workspace diagnostics picker (**LSP**) | `workspace_diagnostics_picker` | | `r` | Rename symbol (**LSP**) | `rename_symbol` | | `a` | Apply code action (**LSP**) | `code_action` | | `'` | Open last fuzzy picker | `last_picker` | @@ -277,7 +287,7 @@ This layer is a kludge of mappings, mostly pickers. | `/` | Global search in workspace folder | `global_search` | | `?` | Open command palette | `command_palette` | -> TIP: Global search displays results in a fuzzy picker, use `space + '` to bring it back up after opening a file. +> TIP: Global search displays results in a fuzzy picker, use `Space + '` to bring it back up after opening a file. ##### Popup @@ -310,10 +320,10 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire | `]t` | Go to previous test (**TS**) | `goto_prev_test` | | `]p` | Go to next paragraph | `goto_next_paragraph` | | `[p` | Go to previous paragraph | `goto_prev_paragraph` | -| `[space` | Add newline above | `add_newline_above` | -| `]space` | Add newline below | `add_newline_below` | +| `[Space` | Add newline above | `add_newline_above` | +| `]Space` | Add newline below | `add_newline_below` | -## Insert Mode +## Insert mode Insert mode bindings are somewhat minimal by default. Helix is designed to be a modal editor, and this is reflected in the user experience and internal @@ -322,44 +332,47 @@ escaping from insert mode to normal mode. For this reason, new users are strongly encouraged to learn the modal editing paradigm to get the smoothest experience. -| Key | Description | Command | -| ----- | ----------- | ------- | -| `Escape` | Switch to normal mode | `normal_mode` | -| `Ctrl-x` | Autocomplete | `completion` | -| `Ctrl-r` | Insert a register content | `insert_register` | -| `Ctrl-w`, `Alt-Backspace`, `Ctrl-Backspace` | Delete previous word | `delete_word_backward` | -| `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | `delete_word_forward` | -| `Ctrl-u` | Delete to start of line | `kill_to_line_start` | -| `Ctrl-k` | Delete to end of line | `kill_to_line_end` | -| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` | -| `Backspace`, `Ctrl-h` | Delete previous char | `delete_char_backward` | -| `Delete`, `Ctrl-d` | Delete next char | `delete_char_forward` | - -However, if you really want navigation in insert mode, this is supported. An -example config that gives the ability to use arrow keys while still in insert -mode: +| Key | Description | Command | +| ----- | ----------- | ------- | +| `Escape` | Switch to normal mode | `normal_mode` | +| `Ctrl-s` | Commit undo checkpoint | `commit_undo_checkpoint` | +| `Ctrl-x` | Autocomplete | `completion` | +| `Ctrl-r` | Insert a register content | `insert_register` | +| `Ctrl-w`, `Alt-Backspace` | Delete previous word | `delete_word_backward` | +| `Alt-d`, `Alt-Delete` | Delete next word | `delete_word_forward` | +| `Ctrl-u` | Delete to start of line | `kill_to_line_start` | +| `Ctrl-k` | Delete to end of line | `kill_to_line_end` | +| `Ctrl-h`, `Backspace` | Delete previous char | `delete_char_backward` | +| `Ctrl-d`, `Delete` | Delete next char | `delete_char_forward` | +| `Ctrl-j`, `Enter` | Insert new line | `insert_newline` | + +These keys are not recommended, but are included for new users less familiar +with modal editors. + +| Key | Description | Command | +| ----- | ----------- | ------- | +| `Up` | Move to previous line | `move_line_up` | +| `Down` | Move to next line | `move_line_down` | +| `Left` | Backward a char | `move_char_left` | +| `Right` | Forward a char | `move_char_right` | +| `PageUp` | Move one page up | `page_up` | +| `PageDown` | Move one page down | `page_down` | +| `Home` | Move to line start | `goto_line_start` | +| `End` | Move to line end | `goto_line_end_newline` | + +If you want to disable them in insert mode as you become more comfortable with modal editing, you can use +the following in your `config.toml`: ```toml [keys.insert] -"up" = "move_line_up" -"down" = "move_line_down" -"left" = "move_char_left" -"right" = "move_char_right" -"C-b" = "move_char_left" -"C-f" = "move_char_right" -"A-b" = "move_prev_word_end" -"C-left" = "move_prev_word_end" -"A-f" = "move_next_word_start" -"C-right" = "move_next_word_start" -"A-<" = "goto_file_start" -"A->" = "goto_file_end" -"pageup" = "page_up" -"pagedown" = "page_down" -"home" = "goto_line_start" -"C-a" = "goto_line_start" -"end" = "goto_line_end_newline" -"C-e" = "goto_line_end_newline" -"A-left" = "goto_line_start" +up = "no_op" +down = "no_op" +left = "no_op" +right = "no_op" +pageup = "no_op" +pagedown = "no_op" +home = "no_op" +end = "no_op" ``` ## Select / extend mode @@ -387,7 +400,6 @@ Keys to use within picker. Remapping currently not supported. | `PageDown`, `Ctrl-d` | Page down | | `Home` | Go to first entry | | `End` | Go to last entry | -| `Ctrl-space` | Filter options | | `Enter` | Open selected | | `Ctrl-s` | Open horizontally | | `Ctrl-v` | Open vertically | @@ -411,8 +423,8 @@ Keys to use within prompt, Remapping currently not supported. | `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | | `Ctrl-u` | Delete to start of line | | `Ctrl-k` | Delete to end of line | -| `backspace`, `Ctrl-h` | Delete previous char | -| `delete`, `Ctrl-d` | Delete next char | +| `Backspace`, `Ctrl-h` | Delete previous char | +| `Delete`, `Ctrl-d` | Delete next char | | `Ctrl-s` | Insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later | | `Ctrl-p`, `Up` | Select previous history | | `Ctrl-n`, `Down` | Select next history | diff --git a/book/src/remapping.md b/book/src/remapping.md index bd4ac7f8..e89c6611 100644 --- a/book/src/remapping.md +++ b/book/src/remapping.md @@ -11,11 +11,11 @@ this: ```toml # At most one section each of 'keys.normal', 'keys.insert' and 'keys.select' [keys.normal] -C-s = ":w" # Maps the Control-s to the typable command :w which is an alias for :write (save file) -C-o = ":open ~/.config/helix/config.toml" # Maps the Control-o to opening of the helix config file +C-s = ":w" # Maps the Ctrl-s to the typable command :w which is an alias for :write (save file) +C-o = ":open ~/.config/helix/config.toml" # Maps the Ctrl-o to opening of the helix config file a = "move_char_left" # Maps the 'a' key to the move_char_left command w = "move_line_up" # Maps the 'w' key move_line_up -"C-S-esc" = "extend_line" # Maps Control-Shift-Escape to extend_line +"C-S-esc" = "extend_line" # Maps Ctrl-Shift-Escape to extend_line g = { a = "code_action" } # Maps `ga` to show possible code actions "ret" = ["open_below", "normal_mode"] # Maps the enter key to open_below then re-enter normal mode @@ -25,7 +25,7 @@ j = { k = "normal_mode" } # Maps `jk` to exit insert mode ``` > NOTE: Typable commands can also be remapped, remember to keep the `:` prefix to indicate it's a typable command. -Control, Shift and Alt modifiers are encoded respectively with the prefixes +Ctrl, Shift and Alt modifiers are encoded respectively with the prefixes `C-`, `S-` and `A-`. Special keys are encoded as follows: | Key name | Representation | diff --git a/book/src/themes.md b/book/src/themes.md index 9738912c..392b5f8c 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -107,6 +107,21 @@ Some styles might not be supported by your terminal emulator. | `double_line` | +### Inheritance + +Extend upon other themes by setting the `inherits` property to an existing theme. + +```toml +inherits = "boo_berry" + +# Override the theming for "keyword"s: +"keyword" = { fg = "gold" } + +# Override colors in the palette: +[palette] +berry = "#2A2A4D" +``` + ### Scopes The following is a list of scopes available to use for styling. @@ -228,49 +243,53 @@ These scopes are used for theming the editor interface. - `hover` - for hover popup ui -| Key | Notes | -| --- | --- | -| `ui.background` | | -| `ui.background.separator` | Picker separator below input line | -| `ui.cursor` | | -| `ui.cursor.insert` | | -| `ui.cursor.select` | | -| `ui.cursor.match` | Matching bracket etc. | -| `ui.cursor.primary` | Cursor with primary selection | -| `ui.linenr` | Line numbers | -| `ui.linenr.selected` | Line number for the line the cursor is on | -| `ui.statusline` | Statusline | -| `ui.statusline.inactive` | Statusline (unfocused document) | -| `ui.statusline.normal` | Statusline mode during normal mode ([only if `editor.color-modes` is enabled][editor-section]) | -| `ui.statusline.insert` | Statusline mode during insert mode ([only if `editor.color-modes` is enabled][editor-section]) | -| `ui.statusline.select` | Statusline mode during select mode ([only if `editor.color-modes` is enabled][editor-section]) | -| `ui.statusline.separator` | Separator character in statusline | -| `ui.popup` | Documentation popups (e.g space-k) | -| `ui.popup.info` | Prompt for multiple key options | -| `ui.window` | Border lines separating splits | -| `ui.help` | Description box for commands | -| `ui.text` | Command prompts, popup text, etc. | -| `ui.text.focus` | | -| `ui.text.info` | The key: command text in `ui.popup.info` boxes | -| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][editor-section])| -| `ui.virtual.whitespace` | Visible white-space characters | -| `ui.virtual.indent-guide` | Vertical indent width guides | -| `ui.menu` | Code and command completion menus | -| `ui.menu.selected` | Selected autocomplete item | -| `ui.menu.scroll` | `fg` sets thumb color, `bg` sets track color of scrollbar | -| `ui.selection` | For selections in the editing area | -| `ui.selection.primary` | | -| `ui.cursorline.primary` | The line of the primary cursor | -| `ui.cursorline.secondary` | The lines of any other cursors | -| `warning` | Diagnostics warning (gutter) | -| `error` | Diagnostics error (gutter) | -| `info` | Diagnostics info (gutter) | -| `hint` | Diagnostics hint (gutter) | -| `diagnostic` | Diagnostics fallback style (editing area) | -| `diagnostic.hint` | Diagnostics hint (editing area) | -| `diagnostic.info` | Diagnostics info (editing area) | -| `diagnostic.warning` | Diagnostics warning (editing area) | -| `diagnostic.error` | Diagnostics error (editing area) | +| Key | Notes | +| --- | --- | +| `ui.background` | | +| `ui.background.separator` | Picker separator below input line | +| `ui.cursor` | | +| `ui.cursor.insert` | | +| `ui.cursor.select` | | +| `ui.cursor.match` | Matching bracket etc. | +| `ui.cursor.primary` | Cursor with primary selection | +| `ui.gutter` | Gutter | +| `ui.gutter.selected` | Gutter for the line the cursor is on | +| `ui.linenr` | Line numbers | +| `ui.linenr.selected` | Line number for the line the cursor is on | +| `ui.statusline` | Statusline | +| `ui.statusline.inactive` | Statusline (unfocused document) | +| `ui.statusline.normal` | Statusline mode during normal mode ([only if `editor.color-modes` is enabled][editor-section]) | +| `ui.statusline.insert` | Statusline mode during insert mode ([only if `editor.color-modes` is enabled][editor-section]) | +| `ui.statusline.select` | Statusline mode during select mode ([only if `editor.color-modes` is enabled][editor-section]) | +| `ui.statusline.separator` | Separator character in statusline | +| `ui.popup` | Documentation popups (e.g Space + k) | +| `ui.popup.info` | Prompt for multiple key options | +| `ui.window` | Border lines separating splits | +| `ui.help` | Description box for commands | +| `ui.text` | Command prompts, popup text, etc. | +| `ui.text.focus` | | +| `ui.text.info` | The key: command text in `ui.popup.info` boxes | +| `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][editor-section]) | +| `ui.virtual.whitespace` | Visible whitespace characters | +| `ui.virtual.indent-guide` | Vertical indent width guides | +| `ui.menu` | Code and command completion menus | +| `ui.menu.selected` | Selected autocomplete item | +| `ui.menu.scroll` | `fg` sets thumb color, `bg` sets track color of scrollbar | +| `ui.selection` | For selections in the editing area | +| `ui.selection.primary` | | +| `ui.cursorline.primary` | The line of the primary cursor ([if cursorline is enabled][editor-section]) | +| `ui.cursorline.secondary` | The lines of any other cursors ([if cursorline is enabled][editor-section]) | +| `ui.cursorcolumn.primary` | The column of the primary cursor ([if cursorcolumn is enabled][editor-section]) | +| `ui.cursorcolumn.secondary` | The columns of any other cursors ([if cursorcolumn is enabled][editor-section]) | +| `warning` | Diagnostics warning (gutter) | +| `error` | Diagnostics error (gutter) | +| `info` | Diagnostics info (gutter) | +| `hint` | Diagnostics hint (gutter) | +| `diagnostic` | Diagnostics fallback style (editing area) | +| `diagnostic.hint` | Diagnostics hint (editing area) | +| `diagnostic.info` | Diagnostics info (editing area) | +| `diagnostic.warning` | Diagnostics warning (editing area) | +| `diagnostic.error` | Diagnostics error (editing area) | You can check compliance to spec with diff --git a/book/src/usage.md b/book/src/usage.md index fc3a83ee..646bf926 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -53,7 +53,7 @@ Multiple characters are currently not supported, but planned. ## Syntax-tree Motions -`A-p`, `A-o`, `A-i`, and `A-n` (or `Alt` and arrow keys) move the primary +`Alt-p`, `Alt-o`, `Alt-i`, and `Alt-n` (or `Alt` and arrow keys) move the primary selection according to the selection's place in the syntax tree. Let's walk through an example to get familiar with them. Many languages have a syntax like so for function calls: @@ -100,13 +100,13 @@ in the tree above. func([arg1], arg2, arg3) ``` -Using `A-n` would select the next sibling in the syntax tree: `arg2`. +Using `Alt-n` would select the next sibling in the syntax tree: `arg2`. ``` func(arg1, [arg2], arg3) ``` -While `A-o` would expand the selection to the parent node. In the tree above we +While `Alt-o` would expand the selection to the parent node. In the tree above we can see that we would select the `arguments` node. ``` @@ -114,10 +114,10 @@ func[(arg1, arg2, arg3)] ``` There is also some nuanced behavior that prevents you from getting stuck on a -node with no sibling. If we have a selection on `arg1`, `A-p` would bring us +node with no sibling. If we have a selection on `arg1`, `Alt-p` would bring us to the previous child node. Since `arg1` doesn't have a sibling to its left, -though, we climb the syntax tree and then take the previous selection. So `A-p` -will move the selection over to the "func" `identifier`. +though, we climb the syntax tree and then take the previous selection. So +`Alt-p` will move the selection over to the "func" `identifier`. ``` [func](arg1, arg2, arg3) |