Home Download Buy Blog Forum Support

HTML snippets no longer working

HTML snippets no longer working

Postby FalconNL on Tue Feb 01, 2011 9:06 am

Problem: It appears as though the only HTML snippets that still work in ST2 are script_tag and style_tag, since they have an explicit tabTrigger. All others, like html and elementid don't work anymore, despite the fact that as far as I can tell the snippets themselves are unaltered from those in ST1.

Steps to reproduce: Create a blank .html document. Type html and press tab. This produces the word html followed by four spaces (or a tab, depending on your settings) rather than the expected document skeleton.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: HTML snippets no longer working

Postby tstrokes on Tue Feb 01, 2011 3:07 pm

I can confirm this on all platforms.
Windows 7
OSX 1.6.6
Ubuntu 10.10
--tstrokes
tstrokes
 
Posts: 17
Joined: Wed Dec 03, 2008 6:39 pm

Re: HTML snippets no longer working

Postby n00ge on Tue Feb 01, 2011 3:53 pm

I haven't looked into this but I just figured they weren't built in. Aren't they just tied into Zencoding or the WebDeveloper packages? Might need to wait for those to get ported or setup some snippets of your own in the meantime.
http://twitter.com/n00ge
Sublime Text 3 dev builds | OS X 10.8.2 & Ubuntu 13.04
n00ge
 
Posts: 140
Joined: Mon Oct 05, 2009 1:23 am

Re: HTML snippets no longer working

Postby FalconNL on Tue Feb 01, 2011 4:06 pm

They worked in ST1 and I had neither of those two packages installed.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: HTML snippets no longer working

Postby guillermooo on Tue Feb 01, 2011 4:44 pm

I've doublechecked this and these snippets relied in regex-based keybindings. I took a quick glance, and I couldn't find any examples of regex-based keybindings in v2, so either they are not implemented or maybe the syntax has changed...
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: HTML snippets no longer working

Postby jps on Wed Feb 02, 2011 7:36 am

Yeah, regex based key bindings are not yet implemented in Sublime Text 2. It's likely the HTML snippets will end up working via a different mechanism this time around.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: HTML snippets no longer working

Postby guillermooo on Wed Feb 02, 2011 7:54 am

That's cool to hear, because, not surprisingly, they precisely seemed to mess up other regex based keybindings (for instance, a watered-down Vim emulation).
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: HTML snippets no longer working

Postby FalconNL on Wed Feb 02, 2011 8:29 am

If you're going to be using a different mechanism anyway, my suggestion would be to bind a script to the tab key in the context of html and xml files that looks at the preceding characters. If it is a valid tag name (with optional attributes), such as body, div#menu or p.caption#caption1, it expands it to the tag. In all other cases, it inserts a tab. This has two advantages over the current approach: you no longer have to type everything in a short timeframe and you can use backspace if you make a mistake.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: HTML snippets no longer working

Postby Phunky on Tue Feb 08, 2011 2:46 pm

FalconNL wrote: If it is a valid tag name (with optional attributes), such as body, div#menu or p.caption#caption1, it expands it to the tag. In all other cases, it inserts a tab.


Sounds like Zen Coding to me :) would love to see this in Sublime!
Phunky
 
Posts: 35
Joined: Mon Feb 07, 2011 5:02 pm

Re: HTML snippets no longer working

Postby squ1b3r on Fri Feb 11, 2011 6:38 am

New scope <scope>text.html</scope>. Just try it. Works for me.
squ1b3r
 
Posts: 45
Joined: Fri Feb 11, 2011 6:35 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 32 guests