How to use hotkeys to add a pair of curley brackets around a variable in visual studio?

24 Views Asked by At

In Javascript/ Typescript, because I need modify all default import to be non-default import, I need to add curly brackets around the original import efficiently for these are modifications in a large scale.

originally,

import UserComponent from './someFile'

and becomes

import {UserComponent} from './someFile'

Are there any hotkeys to add automatically the close curly bracket when I enter the open curly bracket?

2

There are 2 best solutions below

0
Shekhar On BEST ANSWER

No But you can select text and simple press "Shift + { " To add brackets

0
Menheon On

You can extend the available code snippets in VS using the Code Snippets Manager - first answer on this post: Surround code block with curly braces?