Use Sublime Text's Package Control to install this plugin.
Open up Terminal.app and execute these commands:
cd ~/Library/"Application Support"/"Sublime Text 2"/Packages/
git clone git@github.com:pierceray/AMDsnippets.git
cd ~/Library/"Application Support"/"Sublime Text 3"/Packages/
git clone git@github.com:pierceray/AMDsnippets.git
Start typing define and the snippets should appear in the autocomplete.
define( [
'${1:dependencies}'
], function (
${2:DependParam}
) {
${2:DependParam}.${3:methodToCall}();
} );
define( [
'${1:flight/lib/component}'
], function (
component
) {
return component( ${2:functionNameUI} );
function ${2:functionNameUI}() {
this.attributes( {
} );
this.after( 'initialize', function () {
} );
this.${3:methodName} = function(){
};
}
} );
define(
'${1:module_id}',
[
'${2:dependencies}'
], function (
${3:DependParam}
) {
${3:DependParam}.${4:methodToCall}();
} );
Tab through the snippet params and fill in your information.