diff options
Diffstat (limited to 'book')
-rw-r--r-- | book/src/keymap.md | 6 | ||||
-rw-r--r-- | book/src/themes.md | 1 | ||||
-rw-r--r-- | book/src/usage.md | 16 |
3 files changed, 22 insertions, 1 deletions
diff --git a/book/src/keymap.md b/book/src/keymap.md index 0265fe6d..c0c455d3 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -73,6 +73,7 @@ | `Alt-;` | Flip selection cursor and anchor | | `%` | Select entire file | | `x` | Select current line, if already selected, extend to next line | +| `X` | Extend selection to line bounds (line-wise selection) | | | Expand selection to parent syntax node TODO: pick a key | | `J` | join lines inside selection | | `K` | keep selections matching the regex TODO: overlapped by hover help | @@ -150,7 +151,8 @@ Jumps to various locations. ## Match mode Enter this mode using `m` from normal mode. See the relavant section -in [Usage](./usage.md#surround) for an explanation about surround usage. +in [Usage](./usage.md) for an explanation about [surround](./usage.md#surround) +and [textobject](./usage.md#textobject) usage. | Key | Description | | ----- | ----------- | @@ -158,6 +160,8 @@ in [Usage](./usage.md#surround) for an explanation about surround usage. | `s` `<char>` | Surround current selection with `<char>` | | `r` `<from><to>` | Replace surround character `<from>` with `<to>` | | `d` `<char>` | Delete surround character `<char>` | +| `a` `<object>` | Select around textobject | +| `i` `<object>` | Select inside textobject | ## Object mode diff --git a/book/src/themes.md b/book/src/themes.md index d6ed78ba..e5c461fd 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -81,6 +81,7 @@ Possible keys: | `ui.cursor.match` | Matching bracket etc. | | `ui.cursor.primary` | Cursor with primary selection | | `ui.linenr` | | +| `ui.linenr.selected` | | | `ui.statusline` | | | `ui.statusline.inactive` | | | `ui.popup` | | diff --git a/book/src/usage.md b/book/src/usage.md index e6bd60e2..0458071a 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -24,3 +24,19 @@ It can also act on multiple seletions (yay!). For example, to change every occur - `mr([` to replace the parens with square brackets Multiple characters are currently not supported, but planned. + +## Textobjects + +Currently supported: `word`, `surround`. + +![textobject-demo](https://user-images.githubusercontent.com/23398472/124231131-81a4bb00-db2d-11eb-9d10-8e577ca7b177.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) + +| Key after `mi` or `ma` | Textobject selected | +| --- | --- | +| `w` | Word | +| `(`, `[`, `'`, etc | Specified surround pairs | + +Textobjects based on treesitter, like `function`, `class`, etc are planned. |