TextMate Filter Through Command

Posted on February 22, 2008

Sometimes I have to deal with messy html like this:

As you know, indenting it manually is a pain… but I just found out this cool TextMate feature, Filter Through Command:

You can filter your file through a shell command and substitute the content… here I’ve chosen the osx built-in tidy to clean up my html:

And voilĂ , your html gets pretty formatted in a snap…

I just need now to find out a way to automatically strip tidy’s comments at the top of my document… but the annoying part has been done. Pretty simple but clever stuff.

If you know better ways to do this… let me know!