Skip to content

Instantly share code, notes, and snippets.

@taktran
Created October 27, 2016 15:55
Show Gist options
  • Save taktran/da0d0c4f512d2aa2b756b63b17612519 to your computer and use it in GitHub Desktop.
Save taktran/da0d0c4f512d2aa2b756b63b17612519 to your computer and use it in GitHub Desktop.
Atom snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# https://atom.io/docs/latest/using-atom-basic-customization#cson
'.source.js':
'tape test':
'prefix': ['t', 'test']
'body': """
test('$1', function (t) {
t.plan(${2:1});
$3
t.end();
});
"""
'ava test':
'prefix': ['a', 'ava']
'body': """
import test from 'ava';
import $1 from './$2';
test('$1', t => {
$4
});
"""
'module.exports function':
'prefix': ['mod']
'body': """
module.exports = (${1}) => {
${2}
};
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment