How to automatically indent source code?

Jichao picture Jichao · Oct 18, 2010 · Viewed 198.3k times · Source

How can I automatically indent source code in Visual Studio 2010?

I have used Ctrl + K, Ctrl + F, but it does not work; is there any other way/plugin to do this?

Answer

Thomas Weller picture Thomas Weller · Oct 18, 2010

Ctrl+E, D - Format whole doc
Ctrl+K, Ctrl+F - Format selection

Also available in the menu via Edit|Advanced.

Thomas

Edit-
Ctrl+K, Ctrl+D - Format whole doc in VS 2010