91
votes

Is there a way to turn off automatic closing curly brace insertion in vscode? I've gone through the editor settings one by one and turned off everything that was related to formatting, but there was nothing I saw specifically for this.

For example, when I type something like

function()
{

vscode immediately adds } so that I end up with

function()
{}

Then, I press enter, and it has automatically indented the cursor. I don't want it to do any of that. I don't want it to auto insert any closing character or any indentations. I basically just want it to stop helping me and let me type the way I want to type. But I cannot figure out if there is any setting for this?

I'm probably the only person in the word who wants this "feature" so I won't be surprised if this isn't possible.

1
Not Alone, too often this has created bugs in my code.BaneStar007
Related: Visual Studio Code disable auto-quote, for those of you that are looking to disable all of the automatic behavior.jrh
thank you for posting this question. I really like VSCode, but I can not understand a world where a development studio has "do things for you features" that are so hard to figure out how to turn off. How about authors of IDEs start adding "auto stop doing things for me" modes?David Jeske
They have to throw the kitchen sink against the wall and see what gets hailed as innovation. Some things work great (multiple cursors) and other things are useless bling (minimap). 25 years ago we used IDEs without intellisense, autocompile, and even color coding.John Churchill
Annoying as hell, I also disabled the auto-closing quotes and HTML tags "editor.autoClosingQuotes": "never", "html.autoClosingTags": falseMirko

1 Answers

100
votes

[See EDIT below for changed options to this command.]

// Controls if the editor should automatically close brackets after opening them

"editor.autoClosingBrackets": false,

You can also do this in a language-specific way by

"[javascript]": {
    "editor.autoClosingBrackets": false
}

Edit: a later version of vscode has changed this to:

"editor.autoClosingBrackets": "never"

"always", "languageDefined", and "beforeWhitespace" are the new additional options. vscode curly braces settings