Skip to content

Instantly share code, notes, and snippets.

@foxxtrot
Created May 22, 2010 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxxtrot/409816 to your computer and use it in GitHub Desktop.
Save foxxtrot/409816 to your computer and use it in GitHub Desktop.
# 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