SOReader
SOReader

Reputation: 6017

How to turn off brackets/quotes auto-completion in Visual Studio

As it states in the title: how to I turn off brackets/quotes/curly braces autocompletion in MSVS? I'm interested in C# and XAML mostly but other text editors would be nice too.

EDIT: Currently I'm using MSVS 11 with these extensions:

Most of them must have been pre-installed with msvs installation, since I cannot recall installing them by myself ;)

EDIT2: I'm using msvs in this version: Version 11.0.50323.1 QRELB

EDIT3:
I found out the problem does not occur in currently available msvs11.

Upvotes: 146

Views: 110468

Answers (11)

radfast
radfast

Reputation: 548

For anyone still looking for this in Visual Studio Community 2022, it's now a 'General' setting named 'Automatic Brace Completion'. There does not seem to be any per-language setting for this feature, as I would have expected.

General Options: Automatic Brace Completion

(As Gautam Jain already wrote, but it wasn't clear to me that that answer was for VS2022 and it lacked a screenshot.)

Personally I find the feature a frustrating one, as the supplied automatic brace does not follow the formatting rules set in the C# Code Style / Formatting options (i.e. in my project, opening and closing braces each on their own line)

Upvotes: 0

retslig
retslig

Reputation: 928

I realize you did not mention the Productivity Power Tools, however it is very easy to turn off with this. This package can be downloaded via nuget I believe.

Once downloaded go to Tools - Options - Productivity Power Tools - then on the right you will see auto Brace Completion. Turn off!

Upvotes: 13

Gautam Jain
Gautam Jain

Reputation: 6849

The solution for this problem in Visual Studio:

Click on Tools / Options menu, go to Text Editor / All Languages / General and then disable the option "Automatic brace completion".

You can also search for the option using the keyword "brace"

Upvotes: 2

Alan Samet
Alan Samet

Reputation: 1138

For anyone experiencing issues with Razor Pages in Blazor in Visual Studio 2022, there are a number of options under Options >> Text Editor >> Razor Page (.Net Core) >> Advanced that need to be set to False to prevent it from reformatting as soon as you open a statement.

Upvotes: 0

HypoXSyn
HypoXSyn

Reputation: 59

Version 17.2.3 of Visual Studio: Tools -> Options -> Text Editor -> C# -> Uncheck Automatic Brace Completion

Upvotes: 2

albin
albin

Reputation: 655

Regarding ReSharper, you might also need to Clear chaches after adjusting settings as Nate Cook described.

enter image description here

Upvotes: 0

pretzels1337
pretzels1337

Reputation: 355

For those using the 2017 mac version of visual studio: Preferences > Text Editor > Behavior > Automatic Behaviors > "Insert matching brace"

enter image description here

Upvotes: 6

Soenhay
Soenhay

Reputation: 4048

For Visual Studio 2017:

C# only:

Tools > Options > Text Editor > C# > General > Automatic brace completion

All languages:

Tools > Options > Text Editor > All Languages > General > Automatic brace completion

Upvotes: 32

Vince I
Vince I

Reputation: 610

To turn off the double-quote auto complete for XAML in Visual Studio 2015, it is:

Tools -> Options -> Text Editor -> XAML -> Miscellaneous -> Attribute quotes

Upvotes: 10

Nate Cook
Nate Cook

Reputation: 8585

If anyone is by chance using Resharper you may also want to adjust the settings in

(Resharper Menu, Options) - Environment -> Editor -> Editor Behavior 

and

(Resharper Menu, Options) - Environment -> Intellisense -> Completion Behavior

according to your personal preferences, in addition to the built-in Visual Studio settings mentioned by others.

Upvotes: 41

Bob Horn
Bob Horn

Reputation: 34297

If anyone is having this issue with VS 2013, there is a setting for this now. I just reset my VS settings and it started to complete my braces again. For me, it wasn't productivity power tools. You can turn it on/off here:

enter image description here

Upvotes: 200

Related Questions