Regenerate ctags in vim using RVM Regenerate ctags in vim using RVM ruby ruby

Regenerate ctags in vim using RVM


I use bundler to manage gems, so I use

ctags -R `bundle show rails`/../*

to get the tags for gems.


If you're using rvm, you can use rvm gemdir. For example, this is what I'm using:

map <Leader>rt :!ctags --extra=+f --exclude=.git --exclude=log -R * `rvm gemdir`/gems/*<CR><CR>

This will always use the gem directory in your current rvm gemset.


Generic version for tagging all the installed gems (it takes a while):

map <silent><Leader>rt :!ctags --extra=+f --exclude=.git --exclude=log -R * `gem environment gemdir`/gems/*<CR><CR>

If you want to just tag bundled gems (much faster):

map <silent> <Leader>rt :!bundle list --paths=true \| xargs ctags --extra=+f --exclude=.git --exclude=log -R *<CR><CR>