Home Download Buy Blog Forum Support

How do I use the snippets?

How do I use the snippets?

Postby joshuaalan on Thu Jan 07, 2010 8:55 pm

Hi, 3 questions :-)

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.
Posts: 4
Joined: Thu Jan 07, 2010 8:52 pm

Re: How do I use the snippets?

Postby joshuaalan on Fri Jan 08, 2010 12:38 pm

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.
Posts: 4
Joined: Thu Jan 07, 2010 8:52 pm

Re: How do I use the snippets?

Postby myel on Fri Jan 08, 2010 4:53 pm


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! ;)

you can find all snippet shortcuts under tools snippets.

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

you can download textmate snippts from the macromates repository http://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 viewtopic.php?f=5&t=344 / http://sublime.akalias.net/snippets/
Posts: 88
Joined: Sat Mar 22, 2008 11:26 pm

Return to General Discussion

Who is online

Users browsing this forum: Esteban, jbrooksuk and 50 guests