Can Textmate nicely indent HTML

htmltextmate

Does Textmate have a function to nicely indent HTML?

HTML Tidy indents it – but it seems to delete tags as well. (This isn't completely proper HTML, but still!)

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal">
    <head>
        <title></title>
    <script type="text/javascript" src="http://www.speechapi.com/static/lib/swfobject.js"></script>
    <script type="text/javascript" src="http://www.speechapi.com/static/lib/speechapi-1.1.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<body>
    <!-- All above disappears -->       
    <p>Test</p>
    <!-- All below disappears-->
</body>
</html>

Best Answer

You can press +A to select all then Text->Indent Selection.