I use vim-rails and ctags
for navigate of methods. For it I run ctags -R *
in /home/***/.rvm/gems/ruby***/gems
. But in this directory was many folders for one gems just different versions(for example activerecord
v. 3.0.7/3.1.3/3.2.2/3.2.3
). And when I try go to(ctrl+]
) method I get to old version. How I can run ctags only with latest gems version?
You can make bundler show the locations for the gems in the gemfile with
bundle show --paths
If you pipe this list into ctags I think you will have what you need.
bundle show --paths | xargs ctags -R
edit: Summarized in this blogpost: http://heim.no/VIM/2012/04/19/generate-ctags-for-all-bundled-gems-in-a-ruby-project/
If you want to add tags for your project along with the gemfile tags you can use -a
option to append so you can just do:
ctags -R -f .tags && bundle show --paths | xargs ctags -R -a -f .tags
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With