Is there a command in TextMate to re-indent or format text in a file?
I use this all the time in IDE's after pasting in a block of code, removing a block, etc for re-indenting a file.
Bonus points if there is a way to pretty indent, turning this:
has_many :users, :class_name => 'Users', :dependent => :destroy
has_many :comments, :class_name => 'Comments', :dependent => :destroy
into this:
has_many :users, :class_name => 'Users', :dependent => :destroy
has_many :comments, :class_name => 'Comments', :dependent => :destroy
But even just simple reformatting would be awesome.
Not sure if it matters but I'm mostly talking about Ruby-on-Rails apps here.