Skip to content

Instantly share code, notes, and snippets.

@meirish
Created May 6, 2011 22:00
Show Gist options
  • Save meirish/959876 to your computer and use it in GitHub Desktop.
Save meirish/959876 to your computer and use it in GitHub Desktop.
backbone snippet for snipmate w/vim
snippet model
var ${1:model} = Backbone.Model.extend({
initialize: function () {
}
});
var ${2:$1}s = Backbone.Collection.extend({
model: ${3:$1},
url: "${4}"
});
snippet view
var ${1} = Backbone.View.extend({
tagName: "${2}",
events: {
${3}
},
initialize: function () {
_.bindAll(this, "render", ${4});
},
render: function () {
}
});
@meirish
Copy link
Author

meirish commented May 6, 2011

Add this to your .vim/snippets as backbone.snippets folder and set ft=javascript.backbone to get model and view shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment