Auto-Format Code in Visual Studio

Visual Studio will automatically format your selected code by pressing CTRL+K+F (note: hold down the control key continuously, press K then press F).

 

To format all code in your currently active file in Visual Studio, press CTRL+K+D (same note as above).

 

For a list of more pre-defined keyboard shortcuts in Visual Studio 2010 visit this MSDN link: http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

 

And for a great macro to show all active shortcuts, check out this MSDN link: http://msdn.microsoft.com/en-us/library/ms247076(v=VS.100).aspx

 

I continue to be impressed by the depth of tools within Visual Studio.

Leave a Reply

Your email address will not be published. Required fields are marked *