Sublime 3 and the Emmet plugin

After installing Sublime 3 and the package control center you should also install the incredible Emmet plugin.

This plugin helps you write HTML / CSS code lightning fast.
emmetio

For example:
Create a new document in Sublime and save it as index.hml. Inside the sublime editor type

html:5<press tab>

The following HTML document will be generated:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>

</body>
</html>

After you press tab  a default HTML 5 template will be generated. The cursor is positioned at the <title>  tag; this is the most likely item you are going to change. Type your title and move the cursor after the <body>  tag. The type:

ul>li*2>a.link-${$}<press tab>

After you press tab the following HTML will be generated:

<ul>
<li><a href="">1</a></li>
<li><a href="">2</a></li>
</ul>

Explanation of the shortcode:
Create an ul  and with that 2 li  items. Within theli  ahref  is generated with a class link followed by a sequence number. The {$}  inserts the sequence number as text.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *