Reputation: 6017
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
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.
(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
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
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
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
Reputation: 59
Version 17.2.3 of Visual Studio: Tools -> Options -> Text Editor -> C# -> Uncheck Automatic Brace Completion
Upvotes: 2
Reputation: 655
Regarding ReSharper, you might also need to Clear chaches after adjusting settings as Nate Cook described.
Upvotes: 0
Reputation: 355
For those using the 2017 mac version of visual studio: Preferences > Text Editor > Behavior > Automatic Behaviors > "Insert matching brace"
Upvotes: 6
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
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
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
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:
Upvotes: 200