Autoformat your code with Visual Studio 2010

I’ve always used resharper form the autoformatting of my code, but in this case i haven’t installed it, and guess what?
i’m working on a project, received from a 3rd party, in visual studio 2010, with the following style guide used:

use indentation by random

ARGH!
now i realize how much guidance the indentation actually gives you.
But no resharper, so what to do?

Luckily they’ve added a good reformat your code feature in vs2010.
Just press <CTRL><K>, <CTRL><D> (press and hold the Control key, press K and D without releasing the Control key) and phew, the code is readable again.

3 thoughts on “Autoformat your code with Visual Studio 2010

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s