New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to configure where Alternate file looks? #146
Comments
I wouldn't call it easy, but you can set
That's an all-or-nothing example; if you want it to fall back to the default, you'll want a |
Nice. Just did this: " lib/foo.rb -> unit/lib/foo_spec.rb
autocmd User Rails/lib/* let b:rails_alternate = 'unit/' . rails#buffer().name()[0:-4] . '_spec.rb'
" unit/lib/foo_spec.rb -> lib/foo.rb
autocmd User Rails/unit/lib/* let b:rails_alternate = rails#buffer().name()[5:-9] . '.rb' |
Here is an example of " :A on engines/foo/bar.rb -> {spec,unit}/engines/foo/bar_spec.rb
autocmd User Rails/engines/* let common = rails#buffer().name()[0:-4].'_spec.rb' | let spec = 'spec/'.common | let unit = 'unit/'.common | let b:rails_alternate = filereadable(spec) ? spec : unit |
The recently added "classifications" feature provides a more declarative way to do this at the same time as creating a navigation command. |
Oh yes, someone pointed me to that. Haven't tried yet but probably will. Thanks! |
I have projects where I have a fast_spec/ directory in addition to spec/ -- is there a way to have Alternate file look in fast_spec first for alternate files? I didn't see anywhere to easily configure how it searches through unit, spec, etc, but my vimscript knowledge is poor.
The text was updated successfully, but these errors were encountered: