views:

49

answers:

3

Is there an easy way to reformat an XML file while viewing it Visual Studio 2010. For example, if you open a generated app.config file, it might look like:

<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

This is difficult to read, is there a way to instruct Visual Studio 2010 to format this, so that it looks more like:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

Thanks,

Michael Goldshteyn

A: 

Ctrl + A

Ctrl + D

Ctrl + K

Justin Wignall
Have you transposed the D and K?
Paul Spangle
Choosing Format Document over Format selection saves you from having to Ctrl+A first.
Kate Gregory
+2  A: 

Yes you can :

Edit > Advanced > Format document (Ctrl+K Ctrl+D)
madgnome
Thank you! That was easy enough...
Michael Goldshteyn
A: 

If you want to leave your right hand free to do something else, you can use Ctrl+E, Ctrl+D.

Not sure how this is different from Ctrl+K, Ctrl+D.

Paul Spangle