Skip to content

gko/wrap

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wrap selection

This plugin allows you to wrap one or multiple selections with symbol/combination of symbols. You can find it in marketplace

Installation

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:

ext install konstantin.wrapSelection

Usage

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

or

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

features

Predefined patterns

Through «Wrap selected text» you can also use multiple symbols, i.e.:

  • {{ → {{text}}
  • <!-- → <!--text-->
  • <% → <%text%>

Custom user patterns

user patterns

You can also do custom patterns through your settings:

{
	"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:

selection

will become

console.log(`selection`, selection);

Found a bug?

Create a ticket here or insult me at mail[at]konstantin[dot]io

About

📦 vscode extension to wrap selection with symbols/pattern

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published