Debian Codegraph @

book/src/surround.md

raw symbols SCIP
1 ## Surround
2
3 Helix includes built-in functionality similar to [vim-surround](https://github.com/tpope/vim-surround).
4 The keymappings have been inspired from [vim-sandwich](https://github.com/machakann/vim-sandwich):
5
6 ![Surround demo](https://user-images.githubusercontent.com/23398472/122865801-97073180-d344-11eb-8142-8f43809982c6.gif)
7
8 | Key Sequence | Action |
9 | --------------------------------- | --------------------------------------- |
10 | `ms<char>` (after selecting text) | Add surround characters to selection |
11 | `mr<char_to_replace><new_char>` | Replace the closest surround characters |
12 | `md<char_to_delete>` | Delete the closest surround characters |
13
14 You can use counts to act on outer pairs.
15
16 Surround can also act on multiple selections. For example, to change every occurrence of `(use)` to `[use]`:
17
18 1. `%` to select the whole file
19 2. `s` to split the selections on a search term
20 3. Input `use` and hit Enter
21 4. `mr([` to replace the parentheses with square brackets
22
23 Multiple characters are currently not supported, but planned for future release.
24