I have recently upgraded to Visual Studio 2012. Whenever I stand on a curly opening bracket and press tab, it automatically inserts 2 new lines and a closing bracket.
{|<- cursor
Pressing tab gives me.
{
|
}
I wish to disable this behavior. I've searched through the settings, Google and MSDN for the past hour, but I've been unable to find anything that would solve my issue.
I have disabled all installed plugins to see if it would go away, but it didn't.
Go to Tools | Options | Text Editor | C/C++. This dialog displays a window that allows you to toggle Automatic brace completion. Automatic brace completion is the feature where, when you type { , a corresponding } is automatically typed for you.
The behavior you are seeing is being caused by a code snippet. Snippets can be activated by typing the snippet shortcut followed by a tab. Visual Studio 2012 comes with several code snippets pre-installed for several different languages. For the C++ language there a default snippet with a shortcut of {
which expands to:
{
}
The default snippets can't be disabled easily through the default GUI, however you should be able to remove the snippet file which is located at (for English language):
%VSInstallDir%\VC\Snippets\1033\Visual C++\{.snippet
I believe there are other extensions out there for managing snippets as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With