Skip to content

Instantly share code, notes, and snippets.

@andoniabedul
Created May 6, 2020 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andoniabedul/dccfa66442f47477acbf75fe5ba7f60d to your computer and use it in GitHub Desktop.
Save andoniabedul/dccfa66442f47477acbf75fe5ba7f60d to your computer and use it in GitHub Desktop.
{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$0');"
],
"description": "Log output to console"
},
"Print JSON":{
"prefix": "gify",
"body":[
"JSON.stringify($0)"
],
"description": "Transform JSON to String"
},
"Parse JSON":{
"prefix": "jparse",
"body":[
"JSON.parse($0)"
],
"description": "Transform string to JSON"
}
}
@andoniabedul
Copy link
Author

andoniabedul commented May 6, 2020

Each snippet is defined under a snippet name and has a prefix, body and description.
The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the same ids are connected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment