8

I have recently downloaded sublime text 3 and installed emmet. The issue that I am having is that when I write the short code for HTML 5 and press tab, it doesn't work. This method was used in sublime text 2 and it worked. Does anyone have any solutions to this issue?

Mospective
  • 91
  • 1
  • 1
  • 7

7 Answers7

15

type ! and then press Tab. found the answer on cheatsheet

6

Text editor doesn't know what shortcut to expand until you save new file as *.html or change the syntax (bottom/right), because new document starts in plain text.

Rafiozoo
  • 116
  • 1
  • 5
1

I guess that you are looking for something like Html Boilerplate. This package generates a full html5 structure just by typing

htmlboiler

and pressing TAB

EDIT: Just found the answer in the Emmet official cheatsheet; just type

!

And hit TAB (Yes, just the exclamation character).

  • Of course not, what he want is `div.my-class>ul>li*5` then proper HTML will get expanded – tom10271 Apr 08 '16 at 15:41
  • Exactly what @aokaddaoc said. Thankfully I moved on to use Atom editor which allows me to do just that after installing emmet. – Mospective Jul 19 '17 at 18:24
1

You don't need an extension. Just either open an html file, save it as an html file, or hit ctrl + shift + P then type "html" and hit enter to select "Set Syntax: HTML"

Then, simply type "HTML" followed by either tab or ctrl+space.

Justin
  • 945
  • 12
  • 26
0

@ayek is correct, all you need to do is set the document type to HTML; once you do, you can then type "html" and hit tab. Good luck, and happy coding. -KW

LukeCage
  • 19
  • 3
0

Create a new file (no need to save or type anything yet). From the menu, View > Syntax, then select HTML. Now type 'html' and press TAB.

The following appears:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>

</body>
</html>

This didn't need any extra plugins - standard out-of-the-box Sublime 3 functionality :)

nita
  • 1
  • 1
  • 6
-1

The above answer was the unique correct, that worked:
Create a new file (no need to save or type anything yet).
From the menu, View > Syntax, then select HTML.
Now type 'html' and press TAB.

James Risner
  • 5,451
  • 11
  • 25
  • 47