I believe it is called "cuddle" style:
function foo() {
// blah
}
function foo()
{
// blah
}
Does anyone know of any scripts that will go through a file and toggle in one direction or the other? My goal is TextMate integration through a bundle, but any script in any language should be fine. I believe I can hook most any language into textmate through a bundle.
http://www.bierkandt.org/beautify/ is how I solved this. I made a new bundle in Textmate of
/path/to/php ~/Library/Application\ Support/TextMate/beautifyphp/beautify_php -i 5 -v 0 -l -b 0
Now all I do, is select my chunk of php, run the bundle command, and it will reformat it to my liking. It does other nice things, like align equals as well. Granted, align equals is something you can do with the "source" bundle in TextMate already.
The only downside is that it shoves in a "made pretty with phpBeautify" or something like that at the bottom, but it is a quick delete. I am sure I could strip it inside the bundle, but this work is not something I do that often.