Closed samstickland closed 7 years ago
Use {dirname}
and {basename}
.
Hi,
Thanks the reply.. however I think I'm misunderstanding something here :/
This config doesn't work:
let g:rails_projections = {
\ "app/concepts/**/cell/*.rb": {
\ "command": "cell",
\ "affinity": "cell",
\ "alternative": "spec/concepts/{dirname}/cell/{basename}_spec.rb",
\ "related": "app/concepts/{dirname}/view/{basename}.slim"
\ }
\ }
However, if I try it with a specific directory name from my project, like below, then it does work:
let g:rails_projections = {
\ "app/concepts/open_role/cell/*.rb": {
\ "command": "cell",
\ "affinity": "cell",
\ "alternative": "spec/concepts/open_role/cell/{basename}_spec.rb",
\ "related": "app/concepts/open_role/view/{basename}.slim"
\ }
\ }
So looks like **/.../*
support is actually a projectionist.vim feature I never got around to porting over to rails.vim. Someone looking into that would be wonderful, though I'm guessing that won't be the most approachable of tasks to the uninitiated.
A good starting place would be s:readable_projected_with_raw()
in rails.vim and projectionist#query_raw()
in projectionist.vim.
@tpope Oh! I'm looking for that exact feature! Is anyone working on porting this useful projectionist.vim feature to rails.vim?
Subsidiary question: Why does rails.vim mimic the projectionist.vim features rather than calling projectionist.vim if the plugin is present?
Rails.vim's projections are older than Projectionist. The latter was inspired by the former.
Rails.vim's projections are older than Projectionist. The latter was inspired by the former.
It makes sense! Thanks for the quick response and this useful plugin
Hi, great gem! It's already saving me a lot of time :)
I'm wondering if it's possible to use arbitrary levels of nesting in a projection. For example:
This isn't working. The alternative and related commands continue to open the matching spec, which I believe is the default?
If there's a way to do this I'll write up the example in the wiki.