On May 2, 2009, at 7:01 AM, Tobias Jung wrote:
I tried to do this using regular expressions, too, but I kept failing. Maybe there _is_ an easier solution, but here is what works great for me:
I downloaded Beautify PHP from http://www.bierkandt.org/beautify/
Then I added a Bundle Command in TextMate with:
Save: Nothing Command(s): php /path/to/beautify_php -v 0 -l -b 1 Input: Selected Text or Document Output: Replace Selected Text
Note that the correct file is "beautify_php", NOT "beautify_php.php" (which is also contained in the Beautify PHP package). And of course you might want to change the parameters given in the command line.
Excellent, thanks! This is perfect. I could not get it to work at first, I had to set the scope in the bundle item, then I was fine. Thanks for the suggestion.