[TextMate] Feature - managing the snippets

Allan Odgaard allan at macromates.com
Thu Oct 14 19:44:31 UTC 2004


On 14. Oct 2004, at 21:21, profprof at mac.com wrote:

> It would be most useful if the snippets were only active when their 
> respective mode is active. This way, the same trigger could be used 
> for various modes and applications.

The problem with this is that you wouldn't be able to have general 
snippets, and it would require you to set a "belongs to" for each 
snippet.

I'm not completely rejecting the idea (since I definitely do not think 
the current solution is ideal).

What I would however propose is, that when multiple snippets match, it 
will use the snippet from the same bundle as the current syntax rules 
-- if there is none, a menu will show.

This should allow for general snippets, and in most cases will solve 
the ambiguity.

There's still one problem though, for example we have a HTML bundle 
which may contain some HTML snippets, but the PHP bundle has a _new_ 
HTML syntax file, so HTML (PHP) would _not_ treat snippets from the 
HTML bundle with higher priority than any other snippets.

Though this would probably be solved when I do style sheets, since the 
PHP bundle would then not define the HTML syntax (again), but only 
create a new style sheet for the existing HTML syntax.

How does that sound?

Kind regards Allan




More information about the textmate mailing list