How to auto indent and collapse source code in Dreamweaver

- by

I keep forgetting where and how to find this feature. Turns out the Command menu gives us such features:

Screen Shot 2013-11-15 at 09.58.24

  • Commands – Apply Source Formatting (to Selection)

Applies the correct indentations to the entire file, or your selection only. It’s the equivalent of Xcode’s “Editor – Structure – Re-Indent”.

To manually move blocks of code, select the lines that need to be shifted, then hold down OPTION + CMD and press the square brackets to indent and outdent respectively. Not sure what these keys are on Windows.

Collapsing Code

On this note, it is also possible to collapse code that you don’t want to look at. It’s not as easy as using Xcode’s method collapse option. In Dreamweaver, you select the code you want to collapse, then hit one of the little triangles that appears on the left hand side.

Selected but uncollapsed code
Selected but uncollapsed code
Click on the triangle to collapse/uncollapse
Click on the triangle to collapse/expand


If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.