Undefitied
Undefitied

Reputation: 747

WebStorm wrapper text with square brackets

When I select some text, for example form-col and press [ I want to get [form-col] but WebStorm replace selected text with [. Is there a way to configure it?

Upvotes: 1

Views: 172

Answers (2)

LazyOne
LazyOne

Reputation: 165108

  1. Settings/Preferences
  2. Editor | General | Smart Keys
  3. Ensure that Surround selection on typing quote or brace option is enabled

Upvotes: 0

Bobo
Bobo

Reputation: 462

I don't think that functionality exist. However you can use the Live template functionality. It's very useful and it does pretty much the same thing.

To do this, go on : [File]->[Settings]->[Editor]->[Live Templates]->user, Click button + and add a live template like:

add live template

In you html file when you write the abbreviation what you are added, press Tab and it generate you [] and place the cursor after the first [and now you can write your html tag [form-col]

Upvotes: 1

Related Questions