Sublime Forum

How do I use the snippets?

#1

Hi, 3 questions :smile:

1- the manual refers to ‘snippets’, I tried to get it to display the HTML template by just typing ‘h,t,m,l,tab’ like it shows (I think) in the screencast but no luck.
2- I see some rails snippets are in there, how about features like shortcuts to build and so on? Or do we have script this ourselves?
3- Textmate bundles: The manual says there is no ‘dropin’ but there is ‘compatibility’ - what does that mean in practice? Where can I download these ‘compatible’ bundles?

Many thanks.

0 Likes

#2

Right so I’ve answered question 1 myself, seems to be some sort of shortcut not documented anywhere followed by tab.

No idea on question 2 and 3.

Also watched the screencast with no sound, no idea what’s going on the screen? Seems you can do div#wrapper and it auto expands, god knows what else?

Any tutorial out there? I want to like sublime and I got a team of 12 coders eager to get a proper text editor but frankly without docs… it’s a hard sell.

0 Likes

#3

hey,

what do you mean with 1?

the snippets fire in their respective scope, so to fire the html snippet you need at least an empty document with the filetype/syntax set to HTML.

then just type html and press tab.

be careful, the sequence h,t,m,l must be typed with no typos, e.g. when you type htlm, delete lm, type ml and press tab, the snippet won’t trigger. you do not type the comma! :wink:

you can find all snippet shortcuts under tools snippets.

2:
your need to make build scripts yourself, search the forum a bit.

3:
you can download textmate snippts from the macromates repository svn.textmate.org/trunk/Bundles. not all will work out of the box and you will need to change the directory strucutre (no subfolders for example).
take a look at %USER%APPLICATIONDATA%\Sublime Text\Packages\ to see how its done.

you may want to take a look here sublime.akalias.net/snippets/

0 Likes