Skip to content

Instantly share code, notes, and snippets.

@henrik
Last active November 20, 2019 19:18
Show Gist options
  • Save henrik/5676109 to your computer and use it in GitHub Desktop.
Save henrik/5676109 to your computer and use it in GitHub Desktop.
Rails.vim 5 projections.json configuration for our projects. http://robots.thoughtbot.com/post/50107717967/extending-rails-vim-with-custom-commands
{
"app/models/*.rb": {
"command": "model",
"affinity": "model",
"alternate": ["unit/models/%s_spec.rb", "spec/models/%s_spec.rb"],
"related": "db/schema.rb#%p",
"template": "class %S\nend"
},
"spec/factories/*_factory.rb": {
"command": "factory",
"affinity": "model",
"related": "app/models/%s.rb",
"template": "FactoryGirl.define do\n factory :%s do\n end\nend"
},
"app/presenters/*_presenter.rb": {
"command": "presenter",
"affinity": "model",
"alternate": ["unit/presenters/%s_presenter_spec.rb", "spec/presenters/%s_presenter_spec.rb"],
"related": "app/models/%s.rb",
"template": "class %SPresenter\nend"
},
"app/presenters/application_presenter.rb": { "command": "presenter" },
"app/views/documents/*.html.slim": { "related": "app/documents/%s.rb" },
"app/documents/*.rb": { "related": "app/views/documents/%s.html.slim" },
"app/assets/javascripts/*.js.coffee": { "alternate": "spec/javascripts/%s_spec.js.coffee" },
"spec/javascripts/*_spec.js.coffee": { "alternate": "app/assets/javascripts/%s.js.coffee" },
"config/locales/*sv.yml": { "alternate": "%sen.yml" },
"config/locales/*en.yml": { "alternate": "%ssv.yml" },
"lib/*.rb": { "alternate": "unit/lib/%s_spec.rb" },
"unit/lib/*_spec.rb": { "alternate": "lib/%s.rb" },
"unit/*_spec.rb": { "alternate": "app/%s.rb" },
"spec/engines/*_spec.rb": { "alternate": "engines/%s.rb" },
"unit/engines/*_spec.rb": { "alternate": "engines/%s.rb" },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment