[TxMt] Re: exclude snippets from menu

Charilaos Skiadas skiadas at hanover.edu
Fri Mar 30 16:14:58 UTC 2007


On Mar 30, 2007, at 11:05 AM, Patrick Gundlach wrote:

> well, I personally like to have tab completion, I can't see how this
> would work without having the command names as a snippet.
>
Yes, tab completion is indeed nice and I like it too, unfortunately  
there is no easy way to have both worlds.

On the other hand, the command has a very important advantage.  
Suppose I want to create an itemize environment. I can do this with  
current word either "it", or "item" or "itemize". Any of them would  
work. Same for "equation", which can be triggered by "eq", "eqn" or  
"equation". You can't have multiple triggers for the same snippet  
unless you duplicate it.

Another advantage is that the same keyword can be used for both  
environments and commands, with different behavior each time. For  
instance typing "it" and then cmd-shift-{ creates an itemize  
environment, while if instead we use cmd-shift-} we would get  
\textit. So you can use the same shortcuts as long as you are working  
in different contexts, and so all abbreviations can be kept short.

> I guess it's just a matter of taste, right?

To a large extend, yes. Though for bundles in the repository we have  
some guidelines we try to follow, and not having a gozillion snippets  
when a single command would do is one of them.

TextMate needs to load and keep track of all the snippets for  
activated bundles at all times, since at every key press it needs to  
determine if one of these needs to be called. So if every bundle  
created these gozillions of snippets, as I am sure they would like  
to, I think this would actually have a performance hit for TextMate.  
Especially for the bundles that don't ship with TM, which are saved  
in XML format instead of binary, so even just loading them takes some  
(admittedly not too much) time.

> Patrick
>
> Thanks for the feedback, btw.

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College






More information about the textmate mailing list