Skip to content

Instantly share code, notes, and snippets.

@lee-dohm
Created January 28, 2015 12:00
Show Gist options
  • Save lee-dohm/acdefbae191a92e23577 to your computer and use it in GitHub Desktop.
Save lee-dohm/acdefbae191a92e23577 to your computer and use it in GitHub Desktop.
Multi-line 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'
#
'.source.coffee':
Describe:
prefix: 'desc'
body: "describe '$1', ->$0"
It:
prefix: 'it'
body: "it '$1', ->$0"
'.source.gfm':
'MIT License':
prefix: 'mit'
body: """
The MIT License (MIT)
Copyright © 2014 [Lee Dohm](http://www.lee-dohm.com), [Lifted Studios](http://www.liftedstudios.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
README:
prefix: 'readme'
body: """
# Project Name
## Installation
## Use
## Configuration
## Copyright
"""
Installation:
prefix: 'inst'
body: """
This package can be installed from within Atom by entering the [package name] in the Package
Search box in the Settings View and clicking "Install". Or by entering `apm install [package name]`
at the command line.
"""
'.source.ruby':
Before:
prefix: 'bef'
body: 'before { $0 }'
'Before - Do':
prefix: 'befd'
body: "before do$0\nend"
Describe:
prefix: 'desc'
body: "describe $1 do$0\nend"
'FactoryGirl Build':
prefix: 'fgb'
body: 'FactoryGirl.build($1)$0'
'FactoryGirl Build Stubbed':
prefix: 'fgbs'
body: 'FactoryGirl.build_stubbed($1)$0'
'FactoryGirl Create':
prefix: 'fgc'
body: 'FactoryGirl.create($1)$0'
It:
prefix: 'it'
body: 'it { $0 }'
Its:
prefix: 'its'
body: 'its($1) { $0 }'
'It do':
prefix: 'itd'
body: "it '$1' do\n$0\nend"
Let:
prefix: 'let'
body: 'let($1) { $0 }'
'Subject - Named':
prefix: 'subjn'
body: 'subject($1) { $0 }'
Subject:
prefix: 'subj'
body: 'subject { $0 }'
'.source.c':
'main function':
'prefix': 'mainf'
'body': """
int main(int argc, char const *argv[]) {
${1:/*code here*/ }
return 0;
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment