> For the complete documentation index, see [llms.txt](https://ploegert.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ploegert.gitbook.io/til/tools/vim/using-vim-surround-with-a-visual-selection.md).

# Using vim-surround With A Visual Selection

The [`vim-surround`](https://github.com/tpope/vim-surround) plugin allows you to do a variety of actions that have to do with the surrounding characters of text objects.

The `S` keystroke allows you to surround a visual selection with the following character.

First, make a visual selection. Then hit `S`. Then hit a surround character such as `(` or `[` and the area of text that has been visually selected will be wrapped with the respective surround characters.
