[TxMt] need guidance on snippets

Max lists at wickenrode.com
Sun Dec 3 23:17:53 UTC 2006


Hi Lewis,

you don't need to post three times we all got it the first time but
maybe nobody had time to answer.

Lewis Overton schrieb:
> I'm trying to learn about writing useful snippets for things I do
> often. It looks like I need some conceptual help. For example, I use
> this snippet:
>
> <tr>
>     <td><cite>${1:title}</cite></td>
>     <td>${2:composer}<br />
>     arr:${3:arranger}</td>
> </tr>
> </table>$0
>
> with a tab trigger of </table>
>
> already helps a lot when building tables of works performed. It nicely
> gets rid of the ending </table> and inserts another set when I press
> tab at the end of the snippet.
>
> That worked so well I got greedy. I'd like to cause the snippet to
> force the title be Title Case.
Pardon?
>
> A second interest is an easy way to get rid of the break and the
> arranger when the piece doesn't have one without killing the ability
> to use a tab trigger at the end. I can use lots of deletes. Is there a
> better way.
you can put the br and arranger inside another $ e.g.

<tr>
    <td><cite>${1:title}</cite></td>
    <td>${2:composer}${4:<br />
    arr:${3:arranger}}</td>
</tr>
</table>$0

Now you can tab through: title - composer - arranger and with the next
tab you'll select the whole br+arranger block and can delete it.
>
> Fascinating tool, TextMate.
>
> Lewy
>
> PS: I'm having trouble getting posts into the list. If this is a
> duplicate, please forgive me.

Max



More information about the textmate mailing list