HTML5 Snippet for Sublime Text 2

sublime html5 snippet

To set up a new Snippet in Sublime go to:

Tools>New Snippet

That will open a new snippet file with some default text.

For a basic HTML5 template, paste the body of the snippet into the file, like this:

<snippet>
 <content><![CDATA[<!DOCTYPE html>
 <html>
 <head>
   <meta charset="UTF-8">
   <title>$1</title>
 </head>
 <body>
   <h1>$2</h1>
   <p>
     $3
   </p>
 </body>
 </html>]]></content>
 <tabTrigger>html5skel</tabTrigger>
 <scope>text.html</scope>
</snippet>

Save it anywhere in Packages/User/ directory as html-html5skel.sublime-snippet. Restart Sublime, type html5skel, then hit tab. Voila!

Leave a Reply

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