on 44566ea help sign in
helix/book/src/usage.md
26 lines 1.1 kB history raw
1# Usage
3(Currently not fully documented, see the [keymappings](./keymap.md) list for more.)
5## Surround
7Functionality similar to [vim-surround](https://github.com/tpope/vim-surround) is built into
8helix. The keymappings have been inspired from [vim-sandwich](https://github.com/machakann/vim-sandwich):
10![surround demo](https://user-images.githubusercontent.com/23398472/122865801-97073180-d344-11eb-8142-8f43809982c6.gif)
12- `ms` - Add surround characters
13- `mr` - Replace surround characters
14- `md` - Delete surround characters
16`ms` acts on a selection, so select the text first and use `ms<char>`. `mr` and `md` work
17on the closest pairs found and selections are not required; use counts to act in outer pairs.
19It can also act on multiple seletions (yay!). For example, to change every occurance of `(use)` to `[use]`:
21- `%` to select the whole file
22- `s` to split the selections on a search term
23- Input `use` and hit Enter
24- `mr([` to replace the parens with square brackets
26Multiple characters are currently not supported, but planned.