[TxMt] html snippets, why the selected text part?

Allan Odgaard allan at macromates.com
Sat May 21 22:45:30 UTC 2005


On May 22, 2005, at 0:10, Charilaos Skiadas wrote:

> I just realized that a snippet could have both a key equivalent and  
> a tab trigger. Maybe then it would make sense to also bind all  
> those snippets to the same key equivalent, maybe in fact Ctrl-Shift- 
> W, in addition to their tab triggers?

I think that would degrade the current “Wrap selection in tag”  
snippet. Tags are generally 1-4 letters, so having to actually select  
the tag from a list would require more key presses than just entering  
the tag name (after doing ctrl-shift-W).

The thing about ${1:...}$0 is clearly a bug. The reason for putting  
the selection inside is probably because these were all made from the  
same copy, and then a user who does use one more than the others,  
could give it a key equivalent.

The actual necessity of these snippets is indeed questionable with  
the ctrl-space macro. Though some do seem to expect them, and it  
isn't more than a few days since someone complained that these were  
missing in his version ;)

As for changing the general “Wrap selection in tag” snippet to make  
room for an argument, I personally wouldn't like that. Although my  
production of HTML is more or less limited to what I put on my blog,  
and here I just need to wrap text in p, tt, b, code, pre, em etc. The  
only time I need an argument is for when I make links, and here I  
have the “Link using selection” (ctrl-shift-L). I should probably  
update it though (I initially did it when writing the documentation,  
which is why it assumes the current word is a page.html).

Personally I've always seen the default stuff more as a good starting  
point and inspiration than actually trying to cater to evrybodys  
needs. The idea with TM is that you setup the stuff how you prefer  
it, rather than adapt your working patterns to how it is setup by  
default. That's one of the reasons why I try to make this is easy as  
possible for the user to edit! :)




More information about the textmate mailing list