Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gko/wrap

📦 vscode extension to wrap selection with symbols/pattern
https://github.com/gko/wrap

selection symbols vscode vscode-extension wrap

Last synced: 3 months ago
JSON representation

📦 vscode extension to wrap selection with symbols/pattern

Awesome Lists containing this project

README

        

# Wrap selection

This plugin allows you to wrap one or multiple selections with symbol/combination of symbols.
You can find it in [marketplace](https://marketplace.visualstudio.com/items?itemName=konstantin.wrapSelection)

## Installation

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:
```bash
ext install konstantin.wrapSelection
```

## Usage

Select something → ctrl+shift+P → «Wrap selected text»

or

press ', ", «, ], < or ) — both opening or closing symbol would work

![features](https://github.com/gko/wrap/raw/master/features.gif)

### Predefined patterns

Through «Wrap selected text» you can also use multiple symbols, i.e.:
- `{{` → `{{text}}`
- ``
- `<%` → `<%text%>`

### Custom user patterns
![user patterns](https://github.com/gko/wrap/raw/master/userDefined.gif)

You can also do custom patterns through your settings:
``` json
{
"wrapSelection.patterns": {
"log": "console.log(`${text}`, ${text})",
"promise": "new Promise((yeah, nah) => yeah(${text}))",
"=>": "() => ${text}"
}
}
```

And then you can do ctrl+shift+P → «Wrap selected text» → log:
```js
selection
```
will become
```js
console.log(`selection`, selection);
```

## Found a bug?
Create a ticket [here](https://github.com/gko/wrap/issues)
or insult me at mail[at]konstantin[dot]io