Create a gist now

Instantly share code, notes, and snippets.

# YUI3 Snippets file for Vim SnipMate plugin
# http://www.vim.org/scripts/script.php?script_id=2540
# File Format should be simlar to TextMate
# Filetype option in VIM should be set to javascript.yui3
# YUI use block
snippet yui
YUI().use(${1}, function(Y) {
${2}
});
#Standard YUI3.io GET call
snippet io
Y.io(${1:uri}, {
on: {
success: function(txid, response) {
${2:body}
}
}
});
snippet on
on({${1:eventName}, function(ev) {
${2:// body}
});
snippet pd
preventDefault();
snippet each
Y.Array.each(${1:array}, function(value, index, array) {
${2:// body}
});
snippet delegate
Y.delegate(${1:event}, function(ev) {
${4:// body...}
}, ${2:parentSelector}, ${3:childSelector});
snippet yadd
YUI.add(${1:name}, function(Y) {
${4:// body}
}, ${2:'version'}, ${3:{}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment