# vim: Surround in visual mode \(\#13347\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/77b2da2b4254f855e50933ef180c813d0f8d01e4)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 77b2da2b4254f855e50933ef180c813d0f8d01e4

Requested commit: 77b2da2b4254f855e50933ef180c813d0f8d01e4

Commit: 77b2da2b4254f855e50933ef180c813d0f8d01e4

Tree: ccf240011bcbf67f516f7cdc7ce2c6d60773a8c5

Author: Benjamin Davies

Committer: GitHub

## Message

```
vim: Surround in visual mode (#13347)

Adds support for surrounding text in visual/visual-line/visual-block
mode by re-using the `AddSurrounds` operator. There is no default
binding though so the user must follow the instructions to enable it.

Note that the behaviour varies slightly for the visual-line and
visual-block modes. In visual-line mode the surrounds are placed on
separate lines (the vim-surround extension also indents the contents but
I opted not to as that behaviour is less important with the use of code
formatters). In visual-block mode each of the selected regions is
surrounded and the cursor returns to the beginning of the selection
after the action is complete.

Release Notes:

- Added action to surround text in visual mode (no default binding).

Fixes #13122
```

## Parents

- [5a8c2a4a884fe049d92406caea2fa86a90e2f51d](https://git.cafe/gitcafe/zed/commit/5a8c2a4a884fe049d92406caea2fa86a90e2f51d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/77b2da2b4254f855e50933ef180c813d0f8d01e4?format=markdown)
