tpope/vim-rails

:Ctags command returns “E492: Not an editor command: Ctags” error

sdondley opened this issue · 3 comments

I have vim-rails plugin installed (it's definitely installed as evidenced by good output from :echo rails#app()). I have ctags installed with: brew install --with-jansson --HEAD universal-ctags/universal-ctags/universal-ctags

When I run :Ctags in vim exec mode, I get the error: :Ctags command returns "E492: Not an editor command: Ctags" error. I have tried running this command from Gemfile and .rb files inside the rails app.

I had to run :call rails#buffer_setup() from the exec line to get ctags function to be recognized. Why is that? I don't see anything in the documentation about having to do that.

I'm loading the plugin with pack like so in an ftplugin/ruby.vim file:

packadd vim-rails

OK, putting packadd vim-rails directly into .vimrc file did the trick. Not sure why that makes a difference, but ok.