Tuesday, June 7, 2011

Autoformatting an Entire File or Selection in Visual Studio

Have you ever copied and pasted some code from the Internet or maintained legacy code that was poorly formatted? Luckily, Visual Studio has some shortcuts to easily fix the formatting.

To auto format the entire document, press Ctrl + K, Ctrl + D
To auto format a selection or a the current line, press Ctrl + K, Ctrl + F  

No comments:

Post a Comment