-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
892c807
commit 753ed4c
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,26 @@ | ||
# Usage | ||
|
||
(Currently not fully documented, see the [keymappings](./keymap.md) list for more.) | ||
|
||
## Surround | ||
|
||
Functionality similar to [vim-surround](https://github.com/tpope/vim-surround) is built into | ||
helix. The keymappings have been inspired from [vim-sandwich](https://github.com/machakann/vim-sandwich): | ||
|
||
![surround demo](https://user-images.githubusercontent.com/23398472/122865801-97073180-d344-11eb-8142-8f43809982c6.gif) | ||
|
||
- `ms` - Add surround characters | ||
- `mr` - Replace surround characters | ||
- `md` - Delete surround characters | ||
|
||
`ms` acts on a selection, so select the text first and use `ms<char>`. `mr` and `md` work | ||
on the closest pairs found and selections are not required; use counts to act in outer pairs. | ||
|
||
It can also act on multiple seletions (yay!). For example, to change every occurance of `(use)` to `[use]`: | ||
|
||
- `%` to select the whole file | ||
- `s` to split the selections on a search term | ||
- Input `use` and hit Enter | ||
- `mr([` to replace the parens with square brackets | ||
|
||
Multiple characters are currently not supported, but planned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters