[TxMt] [TM2] Auto-indentation

17 views
Skip to first unread message

Emmanuel Blot

unread,
Jan 31, 2012, 10:39:20 AM1/31/12
to TextMate users
Hi All,

I'm editing C files with TM2, and the auto indentation is often wrong,
and forces the cursor to move to an unexpected position when I start
writing a new line.

I'm looking for information/guide to:
* disable the whole auto-indentation feature
* configure the auto-indentation feature, if it's feasible
* cancel the last auto-indentation action: Cmd-Z removes both the
indentation and the typed character. In many others editors, Cmd-Z
cancels the automatic action, then a second hit remove the last typed
char. Is there an equivalent in TM2?

Thanks,
Emmanuel.

_______________________________________________
textmate mailing list
text...@lists.macromates.com
http://lists.macromates.com/listinfo/textmate

Carsten Hoever

unread,
Jan 31, 2012, 12:14:40 PM1/31/12
to TextMate users
Same here with MATLAB as language.

David Howden

unread,
Jan 31, 2012, 12:24:25 PM1/31/12
to TextMate users
I find that the main problems are with the "auto-correction" of indentation, you can disable this as follows:

+ Add a settings item to the bundle in question (make sure that the scope for the setting item is set correctly).
+ Add this dict to the settings:  { disableIndentCorrections = '1'; }

David.

David Howden

unread,
Jan 31, 2012, 12:26:28 PM1/31/12
to TextMate users
Of course, if you want to rewrite the indentation rules for the language, then you are free to :-).  Here's a link to the docs:


David.

Emmanuel Blot

unread,
Jan 31, 2012, 1:39:10 PM1/31/12
to TextMate users
> + Add a settings item to the bundle in question (make sure that the scope
> for the setting item is set correctly).
> + Add this dict to the settings:  { disableIndentCorrections = '1'; }

Ok, thanks

Steve King

unread,
Jan 31, 2012, 4:00:58 PM1/31/12
to text...@lists.macromates.com
On 2012-01-31 12:24, David Howden wrote:
> I find that the main problems are with the "auto-correction" of
> indentation, you can disable this as follows:
>
> + Add a settings item to the bundle in question (make sure that the
> scope for the setting item is set correctly).
> + Add this dict to the settings: { disableIndentCorrections = '1'; }

And there was much rejoicing! Do you know if it's possible to do this
globally instead of separately for each bundle?

--
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>

David Howden

unread,
Jan 31, 2012, 8:03:11 PM1/31/12
to TextMate users
I don't think that it is possible to set this globally.

It is strange though.  The bundles that I have written all work correctly - I only seem to have problems with other peoples' bundles :-P

David.

Rob McBroom

unread,
Jan 31, 2012, 10:57:38 PM1/31/12
to TextMate users
On Jan 31, 2012, at 4:00 PM, Steve King wrote:

>> + Add a settings item to the bundle in question (make sure that the scope for the setting item is set correctly).
>> + Add this dict to the settings: { disableIndentCorrections = '1'; }
>
> And there was much rejoicing! Do you know if it's possible to do this globally instead of separately for each bundle?

I think the answer’s right there on the first line. Create the settings in your personal bundle but *don’t* provide a scope at all and it should apply everywhere. (I haven’t tested this.)

--
Rob McBroom
<http://www.skurfer.com/>

Reply all
Reply to author
Forward
0 new messages