# tpope/vim-surround

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tpope-vim-surround).**

14,078 stars · 450 forks · Vim Script

## Links

- GitHub: https://github.com/tpope/vim-surround
- Homepage: https://www.vim.org/scripts/script.php?script_id=1697
- awesome-repositories: https://awesome-repositories.com/repository/tpope-vim-surround.md

## Description

vim-surround is a plugin for managing pairs of enclosing delimiters within the Vim editor. It functions as a text manipulation tool that automates the addition, removal, and replacement of characters and tags that surround text objects.

The tool provides specialized commands to wrap selections, lines, or specific text objects in character pairs such as brackets and quotes. It also enables the replacement of existing delimiters with different pairs or the complete removal of surrounding characters while preserving the internal content.

These capabilities extend to markup languages, allowing for the management of opening and closing XML or HTML tags.

## Tags

### Development Tools & Productivity

- [Vim Plugins](https://awesome-repositories.com/f/development-tools-productivity/vim-plugins.md) — Functions as a specialized Vim plugin for adding and removing brackets, quotes, and tags around text.
- [Cursor Relative Position Calculators](https://awesome-repositories.com/f/development-tools-productivity/cursor-relative-position-calculators.md) — Determines the exact start and end points of surrounding characters relative to the current cursor position.
- [Modal Input Systems](https://awesome-repositories.com/f/development-tools-productivity/modal-input-systems.md) — Uses a modal input system to capture sequences of keystrokes for determining transformation actions.
- [Surrounding Character Management](https://awesome-repositories.com/f/development-tools-productivity/surrounding-character-management.md) — Allows for the complete removal of surrounding characters while preserving the internal content. ([source](https://github.com/tpope/vim-surround#readme))
- [Text Buffer Manipulations](https://awesome-repositories.com/f/development-tools-productivity/text-buffer-manipulations.md) — Implements low-level logic for modifying and deleting characters directly within the active Vim editor buffer.
- [Text Object Selection](https://awesome-repositories.com/f/development-tools-productivity/text-object-selection.md) — Identifies boundaries of enclosed text by leveraging Vim's native text object system.
- [Surrounding Text Wrappers](https://awesome-repositories.com/f/development-tools-productivity/text-object-selection/surrounding-text-wrappers.md) — Provides specialized utilities for adding or changing the surrounding characters of text objects.
- [Balanced Tag Matching](https://awesome-repositories.com/f/development-tools-productivity/balanced-tag-matching.md) — Uses regular expressions to identify and manipulate balanced XML or HTML tags.
- [Code Refactoring Tools](https://awesome-repositories.com/f/development-tools-productivity/code-refactoring-tools.md) — Provides utilities for restructuring code by quickly changing delimiters or wrapping expressions.
- [Markup Tag Manipulators](https://awesome-repositories.com/f/development-tools-productivity/markup-tag-manipulators.md) — Enables wrapping text in XML/HTML tags and efficiently swapping them during editing.

### User Interface & Experience

- [Symmetry-Aware Mappings](https://awesome-repositories.com/f/user-interface-experience/character-encoding-support/automatic-character-pairing/symmetry-aware-mappings.md) — Provides the mapping logic to associate specific keys with pairs of opening and closing delimiters.
