How do I create a new snippet in TextMate 2? When I go to Edit Bundles I can't figure out how to create a new snippet.
TextMate 2 has not yet been released and is in an alpha state. The bundle editor is one of the areas that are very much not final.
These instructions are for Version 2.0 (8956), current as of January 20, 2012. Think before you down vote.
Select Bundles » Edit Bundles… in the TextMate 2 menu.
Select the bundle you want to add a snippet to, e.g. HTML. Press Cmd-N to create a new bundle item, and select Snippet.
It will be automatically added to the Menu Actions subsection. You can change its settings, such as keyboard shortcut, in the drawer, and its contents in the editor at the bottom.
Enter a tab trigger in you want a sequence of characters (e.g.
Scope Selector specifies in which scopes the snippet can be inserted using the trigger. To find out the scopes of your selected language, switch to a document with that syntax, and press Ctrl-Shift-P to show all applicable scopes below the cursor.
For example, if you want your snippet to be available anywhere in HTML documents, enter
For anything else, just look at all the other snippets you can access from that window and see how they achieve some desired behavior.
To add: after you add a snippet to a bundle, you might well want to alter where it appears in the bundle menu. This is currently unsupported in the GUI (as of 2.0-alpha.9401).
You can do it manually if you are a relative expert. You can break the bundle by making errors here, so don't venture in unthinkingly.