[TxMt] Re: insert a column of numbers

Allan Odgaard mailinglist at textmate.org
Tue Oct 8 11:15:53 UTC 2013


On 8 Oct 2013, at 12:53, Ross Ahmed wrote:

> I think the number of keystrokes could be reduced however, by for 
> example making a column selection then inserting numbers. Or is this 
> asking too much?!

TextMate 1.x did work fine with column selections filtered through 
commands, unfortunately this is not yet handled gracefully in 2.0 and 
your email was a reminder that I need to finish that part.

On the general subject, I’ve been considering introducing something 
like a counting variable to use in the replacement (format) string, e.g. 
${iota[:«start»[:«step»]]} which would insert a number starting with 
the optional “«start»” value and incrementing by “«step»” 
each time inserted.

Though this wouldn’t allow inserting the same number twice (as in your 
example). Another approach would be allow “math expression” so that 
one could replace with $((i += 1)) which would inesrt the value of $i 
and then increment it by one. But even this is not overly flexible, yet 
fairly complex (i.e. no-one would probably use it).

I am leaning toward the counting variable, and will probably add that 
when I find a good way to implement it and/or refactor the relevant 
code. Until then, a user could simply insert the literal $iota string 
(via find/relace) and then have a command post-process the document to 
insert seqeunce numbers for these.


More information about the textmate mailing list