Sublime Forum

Html + TAB does nothing

#1

Hello Everybody,

I see on some videos that when you type “html” and then click TAB you get the html base document.
It does not work in my case. Do I have to activate some snippets?
What am I doing wrong?

Thanks in advance :slightly_smiling:

1 Like

#2

It’s a plugin I guess. https://packagecontrol.io/packages/Emmet

1 Like

#3

Thanks.
I have just installed the Emmet, restarted Sublime Text 2 and opened a new doc an type “html” + tab and nothing…
Do I have to activate it somehow?

0 Likes

#4

Is the file syntax html / php / or whatever related to web on the bottom-right corner of you ST?

1 Like

#5

There is HTML in the right corner.

0 Likes

#7
"auto_complete_selector": "text, meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",

I just add text scope into auto_complete_selector and it works. Nothing related to Emmet sorry. To be less aggressive, you may add text.html rather than text.

Emmet uses ! and then tab.

4 Likes

#8

Thank you for your replay.
And where is this auto_complete_selector? How do I go there?

PS
If Emmet is in the right corner and I do ! and tab nothing happens also…

0 Likes

#9

For Emmet, I don’t know. I test it and it works on a clean/portable ST 2.0.2 Win x64 with just package control and emmet installed.

0 Likes

#10

OK :slightly_smiling:
But, how I do this autocomplete selector?

0 Likes

#11

Preferences -> Settings - User

0 Likes

#12

HTML Boilerplate will give you what you want.

0 Likes

HTML Auto-complete problem
#13

OK - this works - thank you :slightly_smiling:

But, what I want is to get following when I type html+tab:

"
!DOCTYPE html>
html>
head>
title>

/head>
body>

/body>
/html>
"

0 Likes

#14

thank you, this is more or less what I wanted :slightly_smiling:

But it is a little too much.

Thank you anyway - now I know what I should look for.

0 Likes

#15

How about Sublime Templates?

1 Like

#16

This is cool with this New File > and choosing type :slightly_smiling:

I will stay with this for the moment, but will still look for this html + tab.

Thank you very much!

0 Likes

#17

How about HTML5? You have to type “HTML5” (without the quotes) plus TAB to get a basic template. Plus, you get other snippets but you will have to experiment, as there is little documentation for this package.

2 Likes

#18

The Emmet plugin is the best one out there. But it needs PyV8 binaries to be downloaded. Did you get a prompt about some error in loading PyV8 binaries while installing Emmet?

0 Likes

#19

No, I don’t have any errors in relation to Emmet, but !+tab does not work either, when Emmet is displayed in the right corner…
I saved empty file as test.html and is not working…

For the moment I am using SublimeTmpl…

0 Likes

#20

You do know that for Emmet to work, you have to manually set the file type to HTML.
When I do that, with Emmet installed, and type HTML + Tab, I get <HTML></HTML>.
I need more than that. I set up my own custom HTML template and open it when I need it.

I don’t use Emmet because it used to conflict with other plug-ins I had.
You could disable all your other packages except Emmet and see if it works. (restart Sublime)
If it works, enable your other packages one at a time until Emmet doesn’t work. (restart Sublime each time)
Then you can decide whether to keep Emmet or the conflicting package.
If that doesn’t work, perhaps you need to re-install Sublime Text.

0 Likes

#21

At least on Sublime Text 3 this works without any plugins. I suggest you stop using ST2 since it is no longer maintained.

With ST3 you can type “html” and press Tab to get base HTML 5 compliant document with base tags.

0 Likes