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

10

144

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:

  • AnkhSVN
  • Concurrency Visualizer
  • PreEmptive Analytics Aggregator Visualizer
  • MSVS PerfWatson
  • VsGraphicsDebuggerPkg
  • Web Tooling 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.

Charity answered 15/6, 2012 at 17:52 Comment(3)
Do you have an extension like ReSharper. I am not aware of any built in functionality to do this.Attainable
I edited my question so it respondes to your question.Charity
It must be something new to Visual Studio 11, which I believe was renamed 2012. You may want to use the version specific tag since you are using a beta/rc.Attainable
S
197

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

Scrivner answered 12/3, 2014 at 17:49 Comment(9)
Alas it doesn't have any effect on the Watch Window among other things.Saltwater
Doesn't work in VS2012 as per the question's tag. The Resharper suggestion from another answer's comments does however work.Sequestrate
But is there a way to disable the completion of double-quotes instead of just the braces. When you start type the opening double-quotes, it completes the closing one and that's annoying for me (wasn't like that until VS2013)...Catboat
For C/C++ it's just Tools > Options > Text Editor > c/c++ > Automatic brace completionHaywoodhayyim
To add to @DougNull's comment, I found it convenient to disable it in "Tools -> Options -> Text Editor -> All Languages" and be done with it.Whitecap
In VS 2015 it has been moved from C# to All Languages.Tetragrammaton
Why in the name of god this option is not shown in the Text Editor -> C# settings when you search for 'brace' is beyond me... imgur.com/a/vW2Z2Gnome
Works for VS2017! "Tools -> Options -> Text Editor -> All Languages"Lubberly
in vs 2015 it keeps reverting to checked after unchecking once per day. I set it in the morning and the rest of the day I am ok until the next day and I have to uncheck it again.Beano
S
40

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.

Selfregulated answered 10/11, 2015 at 15:27 Comment(4)
The first one of those is what worked for me (btw I'm not using C# but C++ with ReSharper C++). Changing the Visual Studio settings in the VS options wasn't enough.Whitecap
To add to my previous comment: changing the R# setting alone isn't enough either. Both the VS settings and the R# setting needs to be changed.Whitecap
This also works for Visual Studio 2017 with the latest edition of ReSharper.Rounded
I don't understand the difference between these two settings. I turned both off!Decasyllable
S
31

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

Spurious answered 1/8, 2017 at 19:18 Comment(5)
Doesn't work in VS 2017. It doesn't save this option.Lowborn
@JanMacháček I seem to have left out the "Text Editor" part of the path. You should be able to find it now.Spurious
Works in VS 2019, tooChat
Doesn't work for quotes!!!Jumbuck
Tested in VS2022 and it still works for brackets and quotes.Spurious
S
12

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!

Skiba answered 15/6, 2012 at 18:27 Comment(3)
I didn't mention it because I'm not using it - that's the only reason. Unfortunatelly PPT did not run under msvs 11 @ the time I was installing the IDE.Charity
Well my last stab at it. you can install re-sharpers 30 day trail and then turn it off. Under options - Environment - EditorSkiba
@retslig, That fixed my vs 2010 brace completion issue! Thanks.Abattoir
M
10

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

Tools -> Options -> Text Editor -> XAML -> Miscellaneous -> Attribute quotes
Mandate answered 1/2, 2017 at 16:30 Comment(1)
Thank you. It is terrible in the XAML editor. I don't know how they thought it would be a productivity gain to have to reach over to End, ->, or Del as you're trying to type your XAML.Rice
F
6

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

enter image description here

Frauenfeld answered 8/2, 2018 at 23:8 Comment(2)
This answer does not answer how to turn off automatic quote completion. Does anyone know how to do this? Examining the same areas of Visual Studio 2017, I don't find a command for quotation marks and auto-completion.Calendula
This setting doesn't seem to actually disable auto brace insertion. Does VS for Mac need to be restarted? Tried closing and reopening the file, no luck. Using vs vim extension, wonder if that's conflicting...Trask
T
2

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

Terebinthine answered 26/9, 2022 at 21:44 Comment(0)
P
1

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'

Phytosociology answered 2/6, 2022 at 10:1 Comment(0)
T
0

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

enter image description here

Tonsure answered 19/10, 2019 at 14:59 Comment(1)
Hi @albin, this will look like a comment, unless you add some more information that make your answer a complete solution to the original question.Desorb
H
0

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.

Hillis answered 14/3, 2024 at 23:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.