dynagirl

posts tagged code

kill trailing spaces with TextMate | 9:47 am | 28 July 2010

I hate untidy code, and always work with invisibles showing. Regardless, sometimes spacecruft slips through. Here’s two ways to fix that:

  1. custom language bundle that highlights the offending space
  2. macro using the built-in strip-trailing-spaces command on save

I’ve gone with the first option: I think it’s nicer to keep yourself in the habit of watching your code, rather than relying on the software. Also, as the author notes, it blows away any bookmarking and code folds. If you’re working with large files and hit save at least every five minutes like I do, well… that sucks as much as Coda’s lack of code folding does.

Site design and content c.1997-2009