Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable brace completion in Visual Studio 2012?

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.

like image 888
Tha Pear Avatar asked Dec 17 '12 18:12

Tha Pear


People also ask

How do I turn on autocomplete in Visual Studio?

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.


1 Answers

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.

like image 117
heavyd Avatar answered Oct 18 '22 09:10

heavyd