On Jul 15, 2006, at 4:36 AM, Andreas Wahlin wrote:
Sorry about the subject. The thing is, I type $('') quite a lot, so much that even a tab- trigger isn't ideal. I'd like to have a key-trigger of $ to just activate the thing. The dealbreaker though is that I also use $$ sometimes, and of course an american might use $ for some other reasons. So I wonder, can you have some "smart" entering here, like the parentheses in a way. The behaviour I'd like is that if I just type $, it will expand to $ ('$1')$0 (shorthand snippet syntax), but if I hit delete directly after typing $, it will revert the thing to a simple $-character. Hope I'm making myself clear :)
btw, Martin Ström, this could be integrated into your new prototype/ scriptaculous bundle ˆ_ˆ
Andreas
I would just assign the snippet the shortcut ⌥$ (option-shift-4) That's only an extra modifier to hold down occasionally instead of a whole extra key to type. And then you're done and can get back to work. ;)
I have a bunch of Smart Smart Typing Pairs that are basically just a snippet like $3"${1:$TM_SELECTED_TEXT}"$2$0 bound to ⌥( ⌥{ ⌥" ⌥' etc... Sometimes you want to wrap something in quotes and brackets at the same time without reselecting stuff.
$("${1:$TM_SELECTED_TEXT}")$0 bound to ⌥$ should be good enough
thomas Aylott—subtleGradient