How to Turn Off Brackets/Quotes Auto-Completion in Visual Studio

What setting controls auto closing quote mark behavior in Visual Studio 2017?

It's 'automatic brace completion', via:

Menu Tools > Options > Text Editor > General > Automatic brace completion

Unfortunately there is no separate option to only apply this for quotes; when disabled you also don't have it for eg. braces, brackets, etc.

disable automatic curly brace or bracket insertion in vscode

A later version of vscode has changed this to:

"editor.autoClosingBrackets": "never"

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

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

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


[Previous, now inaccurate, setting.]

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

"editor.autoClosingBrackets": false,

Disable automatic parenthesis insertion in Visual Studio 2015

Uncheck the "Automatic brace completion" option. Go to menu Tools > Options, then
choose Text Editor > C/C++ > General.

enter image description here

When you type { ( [ " ' /* it will not put the chars } ) ] " ' */

Visual Studio Code bracket auto completion

TL;DR: As of June 2019, it's not possible to disable only the overtyping part of the autocloseBrackets function. You can only disable auto
bracket closing altogether.

Some people suggest using the TabOut Extension for Visual Studio Code to tab out of quotes, brackets, etc.


Ok, so what I found out over at the VSC Github is this:

[...] This can be turned off via editor.autoClosingBrackets. The feature
consists of multiple parts:

  • one is that when ( is typed, the result is (|).

  • the other part that is hit here, is that when ) is typed and ) follows the cursor, ) will be overtyped.


The feature is implemented language agnostic and looks only locally at
the next character. It does not count brackets to determine if the
code is "bracket unbalanced".

(Source: https://github.com/Microsoft/vscode/issues/35799)

At the moment, it's not possible to fix this, without losing the auto
bracket closing feature. The above thread has since been closed. New one is here: https://github.com/Microsoft/vscode/issues/37315 , but no patch has come out yet.

Disable closing bracket swallowing?

I received a solution from github of vscode project.

It works for me. Edit your keybindings.json add the text below:

{
"key": "]",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "]"
}
},
{
"key": "Shift+]",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "}"
}
},
{
"key": "Shift+0",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": ")"
}
}

Notice: "Shift+0" for en keyboard (, edit it for your keyboard layout.



Related Topics



Leave a reply



Submit