diff options
Diffstat (limited to 'book/src/usage.md')
-rw-r--r-- | book/src/usage.md | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/book/src/usage.md b/book/src/usage.md index 9ee8634c..71730fa8 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -2,6 +2,8 @@ (Currently not fully documented, see the [keymappings](./keymap.md) list for more.) +See [tutor.txt](https://github.com/helix-editor/helix/blob/master/runtime/tutor.txt) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction. + ## Registers Vim-like registers can be used to yank and store text to be pasted later. Usage is similar, with `"` being used to select a register: @@ -49,9 +51,10 @@ Multiple characters are currently not supported, but planned. ## Textobjects -Currently supported: `word`, `surround`. +Currently supported: `word`, `surround`, `function`, `class`, `parameter`. ![textobject-demo](https://user-images.githubusercontent.com/23398472/124231131-81a4bb00-db2d-11eb-9d10-8e577ca7b177.gif) +![textobject-treesitter-demo](https://user-images.githubusercontent.com/23398472/132537398-2a2e0a54-582b-44ab-a77f-eb818942203d.gif) - `ma` - Select around the object (`va` in vim, `<alt-a>` in kakoune) - `mi` - Select inside the object (`vi` in vim, `<alt-i>` in kakoune) @@ -60,5 +63,11 @@ Currently supported: `word`, `surround`. | --- | --- | | `w` | Word | | `(`, `[`, `'`, etc | Specified surround pairs | - -Textobjects based on treesitter, like `function`, `class`, etc are planned. +| `f` | Function | +| `c` | Class | +| `p` | Parameter | + +Note: `f`, `c`, etc need a tree-sitter grammar active for the current +document and a special tree-sitter query file to work properly. [Only +some grammars](https://github.com/search?q=repo%3Ahelix-editor%2Fhelix+filename%3Atextobjects.scm&type=Code&ref=advsearch&l=&l=) +currently have the query file implemented. Contributions are welcome ! |