Skip to content

Latest commit

 

History

History

snippets

Snippets

One of the great features of Sublime Text, Snippets are super awesome for a lot of reasons. You can use them to quickly enter vast swatches of text to make your life easier, for one thing.

If you happen to have a terrible memory like I do, then you can use them for other things, such as reminding you of the structure of things that you don't normally use.

The snippets stored here fall into both categories. For test purposes I create a lot of key bindings, so some of the bindings save time. Sometimes these bindings need a context, and that's when I normally have to look at the default bindings to remember how that usually goes.

Boom, snippets to the rescue.

Usage

To use a snippet, just drop it into some package (e.g. your User package) and Sublime will notice it and add it to the list. You can put it inside of a folder inside of a package if desired.

Snippets generally show up as auto-complete entries, but are usually context sensitive, so if you're not seeing one, double check that you are editing the correct type of file. Snippets can also be bound to a key press.

There are copious examples of this in the default key bindings. Most specify snippet content directly, but there is a key that inserts an XML long tag that shows how to bind directly to a file.