Skip to content

Instantly share code, notes, and snippets.

@tylersticka
Created May 17, 2012 18:43
Show Gist options
  • Save tylersticka/2720837 to your computer and use it in GitHub Desktop.
Save tylersticka/2720837 to your computer and use it in GitHub Desktop.
Sublime Text 2 snippet for JS module
<snippet>
<content><![CDATA[
(function(app) {
var ${1:name} = (function() {
return {
${0}
};
})();
app.${1/(.)/\L\1\E/g} = $1;
})(${2:namespace});
]]></content>
<!-- optional, allows you to type 'module' and tab to insert -->
<tabTrigger>module</tabTrigger>
<!-- optional, restricts to JS files -->
<scope>source.js</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment