Take the 2-minute tour ×

Is there a way to prevent this from happening?

Namespace testing
    Public Module TestModule
        Public testobj As New test
    End Module
End Namespace

It is extremely annoying to have to start out two tabs to the right on new code. Is there anyway to disable auto-indenting just for namespace declarations in visual studio 2008?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

There is no setting for turning off specific block type indentations. (There is a setting for C# to turn off block indenting altogether, but again, not specific to certain block types like namespace blocks).

You shouldn't need to hit tab twice though - when you press "enter" on a line of code, it should automatically indent you to where the last line was indented to.

And no matter how you type in your code, it's just a quick keystroke to auto-format the whole document (Ctrl-K followed by Ctrl-D). So you can ignore idents until you're done typing and then auto-format.

share|improve this answer
add comment

Your Answer


