On Apr 30, 2009, at 11:29 AM, Christopher Creutzig wrote:
Should be something like
ruby -0777 -p -e '$_.gsub!(/\n\s*{/ {/)'
or, if you really want to go the other way (:-)), you don't need multi-line matching and can do it right in TextMate, substituting
^(\s*)(\S.*)\s*{\s*$
with
$1$2\n$1{
(I even tested that. It works on your example, which is a start.)
Would you mind explaining how to do this in a bundle, I copied the first example above, and but a ruby shebang in a bundle command, set the scope to source.php. I get a lot of errors when I run it.
Thanks