[TxMt] Incremental Sequences for Replacement

Doug Schepers doug at schepers.cc
Mon Mar 1 08:32:23 UTC 2010


Hi, Allan-

Following up from IRC...

My text editor of choice on Windows was TextPad, and it supported a 
handy way to insert sequential numbers for "replace all" operations. 
This was useful, for example, when inserting line numbers, creating 
unique ids, etc.

I don't know if the syntax was unique to TextPad, or if it is part of 
some standard regex syntax, but it was pretty simple and effective:

\i(<start_index>,<increment>)

\i Replace with numbers starting from 1, incrementing by 1.
\i(10) Replace with numbers starting from 10, incrementing by 1.
\i(0,10) Replace with numbers starting from 0, incrementing by 10.
\i(100,-10) Replace with numbers starting from 100, decrementing by -10.

Any chance this (or something similar) could be added to TextMate?

Thanks-
-Doug



More information about the textmate mailing list