Art of Vim/Vim for Rails Developers: Vendoring Rails?

@benorenstein, been working through the Vim for Rails Developers screencast. Around minute 20, you mention that ctags work best when Rails is vendored. I know this screencast was made a while back, is that practice still the best way to be able to link to Rails API methods?

Also, is the proper way to vendor Rails to use rake rails:freeze:gems?

Thanks,
Geoff

Thanks for the question!

Nope, I donā€™t vendor Rails anymore. And I havenā€™t replaced my method for viewing source on gems/Rails code right from their call-site.

Itā€™s actually been on my todo list for a while. If you find a handy way to pull that off using modern practices, please let me know!

Tpopeā€™s gem-ctags is very nice for exploring library code.

@matt thanks, just gave that a try.

@benorenstein I think changes have been made to either rails or vim-rails that donā€™t require vendoring rails any longer. I ran gf on ActiveRecord::Base and vim jumped to the Rails source on its own.

@matt Nice one!

I have been using ctags in Rails project (Example) to get rails (and gems) recognized by ctags. So far, so good.

1 Like

I recently found a great little bash command that does it all (I wish I could remember where I got it from!) and doesnā€™t require vendoring or an add-on:

ctags -R . $(bundle show --path)
1 Like