Reader small image

You're reading from  Mastering Sublime Text

Product typeBook
Published inDec 2013
PublisherPackt
ISBN-139781849698429
Edition1st Edition
Right arrow
Author (1)
Dan Peleg
Dan Peleg
author image
Dan Peleg

Dan Peleg is an accomplished software engineer. As a former developer in the Israeli Intelligence Force, he holds extensive experience in both defense and robotic industries, and has previously lectured at DefCon conventions. Dan has developed unique algorithms for robotic platforms, specializes in a variety of software platforms, and currently works as the CTO for an American startup company.
Read more about Dan Peleg

Right arrow

Getting to know a snippet


As developers, we all get to write the same short code fragments over and over again on different files and projects. The best example of this is the following code:

<!DOCTYPE html>
<html>
  <head>
    <title> My cool Website </title>
  </head>
  <body>
    <p> Hello World! </p>
  </body>
</html>

We all have written something similar so many times. That's why Sublime has the snippets feature. Snippets are smart templates that insert the right text when we need it, where we need it.

Let's see this example live by using Lorem ipsum. We have this empty HTML page that we wrote using our awesome, fast fingers. Now we want to enter some placeholder text inside the <p> tags, as shown in the following screenshot:

We just type the trigger letter for our snippet, in this case l, and we get all the options. Pressing Tab will insert the snippet as shown in the following screenshot:

Yes! We now have a Lorem ipsum...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Sublime Text
Published in: Dec 2013Publisher: PacktISBN-13: 9781849698429

Author (1)

author image
Dan Peleg

Dan Peleg is an accomplished software engineer. As a former developer in the Israeli Intelligence Force, he holds extensive experience in both defense and robotic industries, and has previously lectured at DefCon conventions. Dan has developed unique algorithms for robotic platforms, specializes in a variety of software platforms, and currently works as the CTO for an American startup company.
Read more about Dan Peleg