I've been experiencing a problem in the otherwise excellent Textmate, it's related to tab-completing a snippet within a tab completed snippet, here's a simple example to illustrate my problem:
I have created a new text.html document and typed mailto<tab> to get the mailto snippet, now in the href value I am attempting to insert another snippet I've created which is a shortcut for my email address, unfortunately it assumes the shortcut is the value for href, then moves to the subject value.
I can understand why Textmate works this way, after all, why would you want to insert a snippet in to a field which expects a literal value, but ideally I would expect it to tab-complete the email address, then another tab to move to the subject field.
On 17/3/2006, at 21:09, Andy Herbert wrote:
[...] but ideally I would expect it to tab-complete the email address, then another tab to move to the subject field.
Nested snippets are on the to-do: http://lists.macromates.com/pipermail/textmate/2005-December/ 007470.html
On Mar 17, 2006, at 2:09 PM, Andy Herbert wrote:
I've been experiencing a problem in the otherwise excellent Textmate, it's related to tab-completing a snippet within a tab completed snippet, here's a simple example to illustrate my problem:
I have created a new text.html document and typed mailto<tab> to get the mailto snippet, now in the href value I am attempting to insert another snippet I've created which is a shortcut for my email address, unfortunately it assumes the shortcut is the value for href, then moves to the subject value.
I can understand why Textmate works this way, after all, why would you want to insert a snippet in to a field which expects a literal value, but ideally I would expect it to tab-complete the email address, then another tab to move to the subject field.
There are a number of reasons why one would want nested snippets, and they are on Allan's todo list, but currently they are not implemented. As a solution to your problem, I would suggest using something like Textpander (http://www.petermaurer.de/nasi.php?section=textpander) for such shortcuts like your email address etc. Or alternatively, don't have your shortcut triggered by a tab trigger, but instead by a key equivalent. As a third solution, you can create a "mymailto" snippet that would automatically insert your email address in there.
Haris