Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add quotation marks around highlighted text in VS Code?

I have recently started to try Visual Studio Code after coming from Sublime Text, but there is one thing I just cannot figure out how to do.

In Sublime Text, if I highlight something and press shift+2 it will add quotation marks at the start and end (the same is true for (, { etc)

However, doing this in VS Code just overwrites the text and leaves me with " which is something I am sure can be fixed, but I have been through the settings twice and unable to find exactly what needs to be changed.

Strangely, if I highlight one of my settings and do the same, it works absolutely fine so this issue seems to be restricted to actual code editing windows.

If anyone can advise on how to change the settings (or an extension which will do this) I would be appreciative! It's a small problem, but one that is a little frustrating.

like image 236
kuwantum Avatar asked Dec 08 '22 14:12

kuwantum


2 Answers

I just highlight something then type a quote and it surrounds the highlighted text in quotes.

It does the same for single quotes, double quotes, parenthesis, brackets, braces.

Maybe this is something new - VS code is changing constantly.

like image 119
Tim Avatar answered Jan 17 '23 09:01

Tim


I don't think there is a built-in way to do this but I tested wrap selection extension and it seems to work well.

like image 33
Mark Avatar answered Jan 17 '23 11:01

Mark