[TxMt] Newbie question -- fixing indentation?

Allan Odgaard throw-away-1 at macromates.com
Sun Apr 23 08:53:30 UTC 2006


On 23/4/2006, at 4:42, Geoff Canyon wrote:

>>> If write a repeat loop (Python) everything indents properly. Then  
>>> I want to surround the repeat loop with an if statement. How do I  
>>> fix the indentation after that so the repeat loop is properly  
>>> indented?
>> Select the "block" after the if statement and hit option-tab to  
>> indent it.
> That certainly works. Is there a way to just get TextMate to re- 
> examine the text as if I were typing it from scratch, and thus  
> indent it all appropriately without me having to figure out where  
> changes are needed?

When should it do that? At all times? And enforcing the estimated  
indent for all lines in your document?

There is no such “feature”.

If however you often wrap code in an if loop, you could create a  
snippet which wraps the selection and adjusts the indent. There is a  
begin … rescue … end snippet in the Ruby bundle which does that --  
select text, press ctrl-shift W, and it will “wrap” the selection in  
begin/rescue/end when the wrapped text given an extra indent.




More information about the textmate mailing list