Skip to content

pierceray/AMDsnippets

Repository files navigation

AMDsnippets

Join the chat at https://gitter.im/pierceray/AMDsnippets Sublime Text AMD Snippets

Installation

Use Sublime Text's Package Control to install this plugin.

Manual Installation

Open up Terminal.app and execute these commands:

Sublime Text 2

cd ~/Library/"Application Support"/"Sublime Text 2"/Packages/
git clone git@github.com:pierceray/AMDsnippets.git

Sublime Text 3

cd ~/Library/"Application Support"/"Sublime Text 3"/Packages/
git clone git@github.com:pierceray/AMDsnippets.git

Snippets

Start typing define and the snippets should appear in the autocomplete.

AMD Anonymous Module

define( [
    '${1:dependencies}'
], function (
    ${2:DependParam}
) {
    ${2:DependParam}.${3:methodToCall}();
} );

AMD Twitter Flight Module

define( [
	'${1:flight/lib/component}'
], function (
	component
) {
	return component( ${2:functionNameUI} );

	function ${2:functionNameUI}() {

		this.attributes( {
		} );

		this.after( 'initialize', function () {
		} );

		this.${3:methodName} = function(){
		};
	}

} );

AMD Named Module

define(
	'${1:module_id}',
[
	'${2:dependencies}'
], function (
	${3:DependParam}
) {
	${3:DependParam}.${4:methodToCall}();
} );

Usage

Tab through the snippet params and fill in your information.

About

Sublime Text AMD Snippets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •