Automatically write a code snippet when choosing a file extension?


Is there a way to automatically write a particular code snippet when choosing a particular file extension. For example, if I created a new .cpp file I want this to show up without me explicitly typing it:

#include <iostream>
int main(int argc, const char *argv[]) 
return 0;


There isn’t a way to do this built-in to Atom. It sounds like an interesting package though!