Skip to content

Instantly share code, notes, and snippets.

@nummi
Created November 15, 2013 15:19
Show Gist options
  • Select an option

  • Save nummi/7485970 to your computer and use it in GitHub Desktop.

Select an option

Save nummi/7485970 to your computer and use it in GitHub Desktop.
Rails.vim ember key bindings
//So you use [rails.vim](https://github.com/tpope/vim-rails) and you're angry that you can't use it because you're not in a rails project and you're in Ember-land. Well do the following and get back to coding:
//1. `touch config/environment.rb` Don't worry, it's in the `.gitignore`
//2. Copy this configuration into `config/projections.json` (also in `.gitignore`)
```javascript
{
"app/js/models/*.js": {
"command": "model",
"alternate": "spec/models/%s_spec.js",
"template": "App.%S = DS.Model.extend({\n});"
},
"app/js/controllers/*.js": {
"command": "controller",
"alternate": "spec/controllers/%s_spec.js",
"template": "App.%SController = Ember.ObjectController.extend({\n});"
},
"app/js/views/*.js": {
"command": "view",
"alternate": "spec/views/%s_spec.js",
"related": "app/js/templates/%s.hb",
"template": "%SView = Ember.View.extend({\n});"
},
"app/js/router.js": {
"command": "router"
},
"app/js/routes/*.js": {
"command": "route",
"alternate": "spec/routes/%s_spec.js",
"template": "App.%SRoute = Ember.Route.extend({\n});"
},
"app/templates/*.hb": {
"command": "template",
"alternate": "app/js/views/%s.js"
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment