[TxMt] Newbie question on snippets

Allan Odgaard throw-away-1 at macromates.com
Wed Feb 1 22:01:42 UTC 2006


On 1/2/2006, at 20:27, Carl Youngblood wrote:

> The next thing it does is highlight the sample string so that I can
> type in something different.  However, I'm having trouble typing
> something in at this point.  If I want to edit the string inside, is
> there a key I can type that will put the caret inside the quotes?  
> [...]

There is not, but the snippet can be changed e.g. to:

    :${1:key} => ${2:"${3:value}"}${4:, }

That way, it would just be pressing tab (again) to get “inside” the  
quotes. If you mainly do use it for strings, it might be more  
efficient to swap the two placeholders:

    :${1:key} => ${3:"${2:value}"}${4:, }

That way it goes first to the value, and on second tab, the quotes.

This snippet is one of the first snippets created for TM, so this  
ability did not exist at the time of creation -- it would make sense  
to update the default snippet to the first version shown here (so  
I'll likely do that).




More information about the textmate mailing list