I'm using Vim with Rails Vim plugin. When trying to tab-complete command :Emodel U or :Econtroller U and then <Tab> it won't recognize the user.rb or user_controller.rb file. But works fine for :Eviews.

Typing :verbose command Eview gives me:

Eview * customlist :execute s:viewEdit("<mods> E<bang>",<f-args>)

and for :verbose command Emodel it prints

Emodel * customlist :execute s:CommandEdit('<mods> E<bang>','model',[{'pattern': 'app/models/*.rb', 'affinity': 'model'}],<f-args>)

Typing :Emodel!<Tab> or any of MVC with ! will allow me to search through existing files in folder. How can I change it so all MVC modes work the same way?

  • Somewhat duplicate of stackoverflow.com/q/60361162/9447571, though this one is more focused than that one.
    – filbranden
    Feb 27 '20 at 10:19
  • Can you try to add plug-in tpope/vim-projectionist and see if that fixes it? From looking at the code, looks like vim-rails can benefit from integration with vim-projectionist...
    – filbranden
    Feb 27 '20 at 10:21
  • 1
    @filbranden "Somewhat duplicate of stackoverflow.com/q/60361162/9447571" - yes that's my question overthere, but meanwhile I've managed to narrow focus on problem thanks to you. I will close it in both places if tpope/vim-projectionist works...
    – Citizen
    Feb 27 '20 at 10:46
  • If projectionist fixes this, feel free to self-reply, that works better!
    – filbranden
    Feb 27 '20 at 10:47
  • Does :echo b:rails_root show you the root directory of your Rails project? Do you have an app/models/ directory there? Do you have *.rb files under it? Can you try :Emodel, space, Ctrl-D to see if it lists anything? Does it work if you start Vim at the root of the project rather than in a subdirectory (assuming you're not already doing so)?
    – filbranden
    Feb 27 '20 at 11:44

I've finally uninstalled and then again installed tpope/vim-rails and also tpope/vim-projectionist. That fixed the problem. I've deleted question stackoverflow.com/q/60361162/9447571.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.