Permanently Remove Double Space in Dreamweaver Code View

Posted on February 14, 2012

If you’re like me and use Dreamweaver as your programming api, you have probably often encountered the problem when retrieving code from the server, only to find that your nicely formatted code has double spaces all over the place.

There are a couple of known methods for quickly removing the breaks including the following:

  1. Go to Edit->Find and Replace (ctrl+F or cmd+F).
  2. In the Find box enter “[\r\n]{2,}” (without the quotes).
  3. In the Replace box enter “\n” (again without the quotes).
  4. Make sure you check the box for “Use regular expression”.
  5. Press the Find All button.

find and replace

Another method, that I prefer to use is to set the code formatting option.

  1. Go to Edit->Preferences (ctrl+u or cmd+u).
  2. Click the Code Format Option.
  3. Under Line break type select your server type.
  4. Click Ok.

Code Format Options

I hope this has helped you. Both these techniques have helped me a lot and saved me a lot of headache when I needed to format many lines of code at once.

7 Comments

Add comment