[TxMt] Nested snippet problem

Charilaos Skiadas cskiadas at uchicago.edu
Fri Mar 17 20:40:22 UTC 2006


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



More information about the textmate mailing list