Code Formatting on the Fly

5/12/2010 12:00 AM By

This may be one of the shorter Dreamweaver tips you’ll encounter, but if you’re working freelance design jobs or interface design jobs, it’s indispensable.

Let’s say you’ve got some teammates, and one of them writes code completely differently than you do. For example, maybe they use two-space tabs instead of real tabs, or they write things on one line that you write on multiple lines, etc. Dreamweaver has you covered with its source formatting system.

First, open up the Coding toolbar (Edit > Toolbars > Coding), then select “Code Format Settings” to set up your preferred formatting. After you’ve got that set exactly how you want it for your various code languages, you can apply it to any open file by selecting “Apply Source Formatting” from the “Format Source Code” icon.

This is a great way to straighten out some minified code as well, which is becoming more and more common as a way to reduce bandwidth needs.

Tags: ,

One Response to “Code Formatting on the Fly”

  1. spudart says:

    Oooooh. I like this tip. “Apply Source Formatting” I’m gonna start using this as I share code with others. Thank you!