Created
May 6, 2011 22:00
-
-
Save meirish/959876 to your computer and use it in GitHub Desktop.
backbone snippet for snipmate w/vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to your .vim/snippets as backbone.snippets folder and set ft=javascript.backbone to get model and view shortcuts.