Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable automatic brace surrounding on selection in Visual Studio

Everything was fine until one update changed a formatting setting and I don't know how to reverse it.

Whenever I select C++ code and try to replace the text with an open brace, it will simply surround the selected text, instead of replacing it with the open brace.

The behavior

This gets really frustrating after a while, e.g. trying to replace a < less symbol with a > symbol is now impossible when using selection. How can I disable this behavior?


I am using Visual Studio Community 2022 Version 17.4.0

like image 460
Stack Danny Avatar asked Nov 27 '25 22:11

Stack Danny


2 Answers

To disable this mode, head to:

Tools -> Options -> Text Editor -> C/C++ -> Advanced

and set Auto Surround Mode to Never.

Disable Auto Surround Mode

like image 127
Stack Danny Avatar answered Nov 30 '25 12:11

Stack Danny


I am using Visual Studio Professional 2022 Version 17.10.3 and I wasn't able to find the setting in the same place as the accepted answer.

In the event that you are unable to find this setting, it might be found under Text Editor -> General, section header "Display", setting name "Automatically surround selections when typing quotes or brackets".

like image 20
Metal Paw Avatar answered Nov 30 '25 13:11

Metal Paw