76

When I want to change from double quotes to single quotes, I'm used to selecting the double quote, and then type a single quote. I'm intending to use the overwrite feature, but instead, I'm getting the 'wrap with quote' feature.

For example:

"id" 

Would result in:

'"'id" 

I always turn this auto surround with wrapping off, but I was unable to find a setting for this in the settings file...

Is there a way to turn this off?

0

3 Answers 3

97

It is possible!

In settings.json which you can open via File>Preferences>UserSettings

UPDATE 2023

There are two settings

"editor.autoSurround": "never", 

Possible values:

  • "never"
  • "languageDefined" - This is vsCode's default
  • "brackets" - meaning it automatically adds brackets, but not quotes
  • "quotes" - meaning it automatically adds quotes but not brackets
"editor.autoClosingQuotes": "never", 

Possible values:

  • "never"
  • "languageDefined" - This is vsCode's default
  • "beforeWhitespace"
  • "always"

PS: In old ancient versions of vsCode, there was less granularity and a single setting would control quotes, braces and brackets. "editor.autoClosingBrackets" : "never"

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks! Quite annoying that you can't control them individually though.
There is a "languageDefined" setting there, I guess it allows to configure it for each language
This is no longer a correct answer. See editor.autoSurround as pointed out in the other answer.
Do you realize autoClosingBrackets is not obsolete and it has a completely different function with autoSurround. Please edit your answer as it doesn't make sense.
I don't have a UserSettings alternative under File>Preferences, but I have a Settings alternatives, which has those specific settings and seems to do what I wanted.
37

I found this question via Google and the selected answer didn't work for me. I'm using VSCode version 1.27.2, and for me the I had to disable the Auto Surround option.

"editor.autoSurround": "never" 

Comments

13

Using VSCode version: 1.36.0

You can use: "editor.autoClosingQuotes": "never"

or

enter image description here

enter image description here

1 Comment

Fwiw, there is a similar UI for Auto Surround, which I think is what this question is looking for.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.