tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.09k stars 381 forks source link

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

Closed sdondley closed 4 years ago

sdondley commented 4 years ago

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.

sdondley commented 4 years ago

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.

sdondley commented 4 years ago

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

packadd vim-rails

sdondley commented 4 years ago

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