Skip to content

Projections for rails.vim

Cliff Braton edited this page Mar 28, 2017 · 1 revision

If you are using vim-rails, you might want to take advantage of projections. For more information on Projections, see this excellent article by Thoughtbot. Here is an example of what the file might look like:

{
  "app/decorators/*_decorator.rb": {
    "command": "decorator",
    "related": "app/models/{}.rb",
    "affinity": "model",
    "test": "spec/decorators/%s_spec.rb",
    "template": [
      "class {camelcase|capitalize|colons}Decorator < Draper::Decorator",
      "end"
    ],
    "keywords": "delegate_all decorates_association object h"
  }
}