[TxMt] help with snippet transformations

Oliver Taylor ollieman at gmail.com
Fri Apr 14 03:13:19 UTC 2006


I'm trying to create a snippet that will create the following:

list: foo / bar / foo

foo does:
foo does not:
bar does:
bar does not:
foo does:
foo does not:

that automatically builds itself based on the number of items in the
slash-separated list ...with tab-stops after all the items.

What I've come up with is:

$1

${1/\/\s*/\n/g}

Which can do this:

foo / bar / foo

foo
bar
foo

but not much else. So I ask you, whose kung-fu is much better than mine.

P.S. - Can you have a transforming snippet that inserts tab-stops for
you? I don't think I've seen that anywhere. That would be awesome.


More information about the textmate mailing list