Apply the rest of the suggestions from the code review

pull/5534/head
David-Else 1 year ago
parent 0fa91eeea8
commit 498be1b7a1
No known key found for this signature in database
GPG Key ID: B221A2F7DC869E40

@ -53,9 +53,9 @@
| `Ctrl-f`, `PageDown` | Move page down | `page_down` | | `Ctrl-f`, `PageDown` | Move page down | `page_down` |
| `Ctrl-u` | Move half page up | `half_page_up` | | `Ctrl-u` | Move half page up | `half_page_up` |
| `Ctrl-d` | Move half page down | `half_page_down` | | `Ctrl-d` | Move half page down | `half_page_down` |
| `Ctrl-i` | Jump forward on the jump list | `jump_forward` | | `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
| `Ctrl-o` | Jump backward on the jump list | `jump_backward` | | `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
| `Ctrl-s` | Save the current selection to the jump list | `save_selection` | | `Ctrl-s` | Save the current selection to the jumplist | `save_selection` |
### Changes ### Changes
@ -221,7 +221,7 @@ various locations.
Match mode is accessed by typing `m` in [normal mode](#normal-mode). Match mode is accessed by typing `m` in [normal mode](#normal-mode).
See the relevant section in [Usage](./usage.md) for an explanation about See the relevant section in [Usage](./usage.md) for an explanation about
[surround](./usage.md#surround) and [text object](./usage.md#textobjects) usage. [surround](./usage.md#surround) and [textobject](./usage.md#textobjects) usage.
| Key | Description | Command | | Key | Description | Command |
| ---------------- | ----------------------------------------------- | -------------------------- | | ---------------- | ----------------------------------------------- | -------------------------- |
@ -229,8 +229,8 @@ See the relevant section in [Usage](./usage.md) for an explanation about
| `s` `<char>` | Surround current selection with `<char>` | `surround_add` | | `s` `<char>` | Surround current selection with `<char>` | `surround_add` |
| `r` `<from><to>` | Replace surround character `<from>` with `<to>` | `surround_replace` | | `r` `<from><to>` | Replace surround character `<from>` with `<to>` | `surround_replace` |
| `d` `<char>` | Delete surround character `<char>` | `surround_delete` | | `d` `<char>` | Delete surround character `<char>` | `surround_delete` |
| `a` `<object>` | Select around text object | `select_textobject_around` | | `a` `<object>` | Select around textobject | `select_textobject_around` |
| `i` `<object>` | Select inside text object | `select_textobject_inner` | | `i` `<object>` | Select inside textobject | `select_textobject_inner` |
TODO: Mappings for selecting syntax nodes (a superset of `[`). TODO: Mappings for selecting syntax nodes (a superset of `[`).
@ -268,7 +268,7 @@ This layer is a kludge of mappings, mostly pickers.
| `f` | Open file picker | `file_picker` | | `f` | Open file picker | `file_picker` |
| `F` | Open file picker at current working directory | `file_picker_in_current_directory` | | `F` | Open file picker at current working directory | `file_picker_in_current_directory` |
| `b` | Open buffer picker | `buffer_picker` | | `b` | Open buffer picker | `buffer_picker` |
| `j` | Open jump list picker | `jump list_picker` | | `j` | Open jumplist picker | `jump list_picker` |
| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` | | `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` |
| `s` | Open document symbol picker (**LSP**) | `symbol_picker` | | `s` | Open document symbol picker (**LSP**) | `symbol_picker` |
| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` | | `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` |

@ -6,7 +6,7 @@
- [User-defined Registers](#user-defined-registers) - [User-defined Registers](#user-defined-registers)
- [Built-in Registers](#built-in-registers) - [Built-in Registers](#built-in-registers)
- [Surround](#surround) - [Surround](#surround)
- [Moving the Primary Selection with Syntax-tree Motions](#moving-the-primary-selection-with-syntax-tree-motions) - [Moving the Selection with Syntax-tree Motions](#moving-the-selection-with-syntax-tree-motions)
- [Selecting and Manipulating Text with Textobjects](#selecting-and-manipulating-text-with-textobjects) - [Selecting and Manipulating Text with Textobjects](#selecting-and-manipulating-text-with-textobjects)
- [Navigating Using Tree-sitter Textobjects](#navigating-using-tree-sitter-textobjects) - [Navigating Using Tree-sitter Textobjects](#navigating-using-tree-sitter-textobjects)
<!--toc:end--> <!--toc:end-->
@ -77,9 +77,9 @@ Surround can also act on multiple selections. For example, to change every occur
Multiple characters are currently not supported, but planned for future release. Multiple characters are currently not supported, but planned for future release.
## Moving the Primary Selection with Syntax-tree Motions ## Moving the Selection with Syntax-tree Motions
`Alt-p`, `Alt-o`, `Alt-i`, and `Alt-n` (or `Alt` and arrow keys) allow you to move the primary `Alt-p`, `Alt-o`, `Alt-i`, and `Alt-n` (or `Alt` and arrow keys) allow you to move the
selection according to its location in the syntax tree. For example, many languages have the selection according to its location in the syntax tree. For example, many languages have the
following syntax for function calls: following syntax for function calls:
@ -119,7 +119,7 @@ a more intuitive tree format:
``` ```
If you have a selection that wraps `arg1` (see the tree above), and you use If you have a selection that wraps `arg1` (see the tree above), and you use
Alt-n, it will select the next sibling in the syntax tree: `arg2`. `Alt-n`, it will select the next sibling in the syntax tree: `arg2`.
```js ```js
// before // before
@ -128,7 +128,7 @@ func([arg1], arg2, arg3)
func(arg1, [arg2], arg3); func(arg1, [arg2], arg3);
``` ```
Similarly, Alt-o will expand the selection to the parent node, in this case, the Similarly, `Alt-o` will expand the selection to the parent node, in this case, the
arguments node. arguments node.
```js ```js
@ -136,15 +136,15 @@ func[(arg1, arg2, arg3)];
``` ```
There is also some nuanced behavior that prevents you from getting stuck on a There is also some nuanced behavior that prevents you from getting stuck on a
node with no sibling. When using Alt-p with a selection on `arg1`, the previous node with no sibling. When using `Alt-p` with a selection on `arg1`, the previous
child node will be selected. In the event that `arg1` does not have a previous child node will be selected. In the event that `arg1` does not have a previous
sibling, the selection will move up the syntax tree and select the previous sibling, the selection will move up the syntax tree and select the previous
element. As a result, using Alt-p with a selection on `arg1` will move the element. As a result, using `Alt-p` with a selection on `arg1` will move the
selection to the "func" `identifier`. selection to the "func" `identifier`.
## Selecting and Manipulating Text with Textobjects ## Selecting and Manipulating Text with Textobjects
In Helix, Textobjects are a way to select, manipulate and operate on a piece of In Helix, textobjects are a way to select, manipulate and operate on a piece of
text in a structured way. They allow you to refer to blocks of text based on text in a structured way. They allow you to refer to blocks of text based on
their structure or purpose, such as a word, sentence, paragraph, or even a their structure or purpose, such as a word, sentence, paragraph, or even a
function or block of code. function or block of code.
@ -177,7 +177,7 @@ Contributions are welcome!
## Navigating Using Tree-sitter Textobject ## Navigating Using Tree-sitter Textobject
Navigating between functions, classes, parameters, and other elements is Navigating between functions, classes, parameters, and other elements is
possible using tree-sitter and Textobject queries. For possible using tree-sitter and textobject queries. For
example to move to the next function use `]f`, to move to previous example to move to the next function use `]f`, to move to previous
class use `[c`, and so on. class use `[c`, and so on.
@ -186,7 +186,7 @@ class use `[c`, and so on.
For the full reference see the [unimpaired][unimpaired-keybinds] section of the key bind For the full reference see the [unimpaired][unimpaired-keybinds] section of the key bind
documentation. documentation.
> 💡 This feature relies on tree-sitter Textobjects > 💡 This feature relies on tree-sitter textobjects
> and requires the corresponding query file to work properly. > and requires the corresponding query file to work properly.
[lang-support]: ./lang-support.md [lang-support]: ./lang-support.md

Loading…
Cancel
Save