# Atom in 60 Seconds: Working With Snippets

This post is part of a series called 60 Second Video Tutorials.
Atom in 60 Seconds: 3 Beautiful Themes
Sketch Mirror in 60 Seconds

Snippets allow you to write a keyword and then expand it into a predefined piece of code. Here are some of my favorite Atom snippets, in sixty seconds!

## How to Create an Atom Snippet

To create your own snippet first go to Atom > Snippets to open snippets.cson (a CoffeeScript Object Notation file). Then you need to define your scope or the file types in which the snippet will be available.

• HTML: .text.html.basic
• CSS: .source.css
• Sass: .source.sass
• JavaScript: .source.js
• JSON: .source.json
• PHP: .text.html.php
• Java: .source.java
• Ruby: .text.html.erb
• Python: .source.python
• Plain text (including markdown): .text.plain

Next, you give your snippet a name and a “trigger keyword” followed by the snippet itself. For example, here the snippet is named “5 item list”, the trigger is “five”, and the content which is outputted is an unordered list with five list items:

 1 '5 item list':  2  'prefix': 'five'  3  'body': """  4 
 5 
• $1 •  6  •$2
•  7 
• $3 •  8  •$4
•  9 
• \$5
•  10 
 11  """ 

As you’ll see in this example, you can add placeholders as the dollar sign, followed by a number.  Also, if the body text has more than one line use triple quotes for separation.

Once done, save, and type the keyword in an HTML file. The snippet will expand and you’ll be able to tab through the placeholders you created.