Home Download Buy Blog Forum Support

HTML snippets

Re: HTML snippets

Postby qqq on Fri Mar 11, 2011 10:43 am

Thanks, that helped.

I've one more question though. If I type say "table" and it completes after TAB and then inside of
Code: Select all
<table></table>

I type "tr" and press TAB again no completion is made only caret goes beyond table tag. Is this default behaviour?
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: HTML snippets

Postby jps on Fri Mar 11, 2011 11:15 am

It is, because you're still within the snippet fields. There are two options:

* Press escape, to cancel the snippet fields
* OR use Ctrl+Space, rather than tab, to insert the tr snippet
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: HTML snippets

Postby qqq on Fri Mar 11, 2011 1:18 pm

Ok.

I'm not exaclty happy with the fact that input->TAB gives simply:

Code: Select all
<input>


instead of:

Code: Select all
<input type="text" name="test" value="value" />


I can easily correct this in HTML.sublime-completions.

The question is what would be the best action if I want to protect my changes in this file from being overwritten? Should I copy it to the "User" folder (this works only if I add a new completion, if completion with the same trigger exists in the original file though it has higher priority)? Copying the whole "HTML" folder to "User" is basically doing the same thing so I don't expect it to work either.
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: HTML snippets

Postby atomi on Fri Mar 11, 2011 5:37 pm

It is, because you're still within the snippet fields. There are two options:
...


Will this always be the case.

The idea of triggering a snippet within snippet field seems like a good one to me.
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: HTML snippets

Postby qqq on Fri Mar 11, 2011 6:31 pm

atomi wrote:The idea of triggering a snippet within snippet field seems like a good one to me.
And the idea isn't new because that is how it worked (should say works) in ST 1.4.
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: HTML snippets

Postby qqq on Wed Apr 06, 2011 9:37 am

I'm still geting some problems here.

1) I've set tab completions to true,
2) the scope is text.html.basic,
3) changed the scope of HTML.sublime-completions file to:
Code: Select all
text.html - source - meta.tag, punctuation.definition.tag.begin, source.php, source.js


Now some triggers work fine and some don't. For example when I press a->tab HTML trigger for <a> loses with PHP one for abs() though the latter should be triggered by abs->tab not by a->tab.

And this had already worked fine, it got bad on the last build or the one before.

Is it possible to change priority of these completions? So that those defined in HTML.sublime-copletions will always prevail over PHP ones, or at least when I'm in heredoc, string etc. Why would I want to type a php function there? And especially one like "cairo_ps_surface_dsc_begin_page_setup()"?

Edit:

As a makeshift solution I deleted the file PHP.sublime-completions. It was pretty useless anyway and with over 4000 (!) hardly-ever used functions getting in the way of whatever you type.
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: HTML snippets

Postby fred on Fri Apr 08, 2011 7:56 am

good posts!
Box: Gentoo Linux
Sublime Version: Version 2 Linux 64 bit
Language: zh_CN.utf8

My Blog: http://fred.oracle1.com
My Website: http://www.sixdating.com
fred
 
Posts: 30
Joined: Fri Mar 18, 2011 8:22 am

Previous

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], Yahoo [Bot] and 28 guests