Tab key not working in VS2010

Solution 1:

I am seeing this problem as well. The following option seems to be the one that triggers the behavior:

Text Editor | C/C++ | Formatting | Automatic Indentation On Tab

If the above setting is True, the tab key will 'fix' the entire line so that it's indented according to how the IDE believes it should be indented (no matter where the cursor is on the line).

Changing the setting to False makes the tab key work as I expect it to. I don't know how this setting got set to True on my machine.

VS 2012 also has this setting, and it works the same way.

Solution 2:

I decided to brute-force fix the issue by going into Options/Environment/Keyboard and bind the [Tab] key with the Edit.InsertTab command for the Text Editor feature. See screenshot below:

Keyboard Options

That seems to have fixed my problem.

Thanks.