[TxMt] Repeating tabstops in snippet
Andrew Henson
elaptics at googlemail.com
Mon Oct 23 17:22:40 UTC 2006
Hi Ed,
Actually that's pretty easy to do.
Create your first snippet like so, assigning the tab trigger to
whatever phrase you like:
<select>
<option value="$1">$2</option>
opt$0
</select>
Then create a second snippet like this:
<option value="$1">$2</option>
opt$0
I have assigned this snippet to a tab trigger of opt. If you call
yours something different, you need to change the opt reference in
the two snippets. When you use the first snippet, you'll tab through
the two values, then tab to the end of "opt", press tab again, which
triggers the opt tab trigger. The same will happen in the second
snippet. The only caveat to this is that when you've added all your
options, you'll have to manually delete out the last opt tab trigger
word. I don't think there's any way around this but is not a major
issue. I'll happily be told if there's a better way!
Hope that helps.
Andy
More information about the textmate
mailing list