Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regenerate ctags in vim using RVM

I have the following code in my .vimrc:

map <Leader>rt :!ctags --extra=+f -R *<CR><CR>

This generates ctags for my current directory.

I'm using RVM, I'm working on different projects, with different ruby versions (trough RVM gemsets.

I have a different $GEM_PATH per project, and I want to generate the ctags for the gems in this path too.

How should the above line be to test if the $GEM_PATH variable is set, and processing these paths too?

Or better still how to check if I have an .rvmrc file, and generate ctags depending of the contents of this file?

like image 263
astropanic Avatar asked Dec 27 '10 14:12

astropanic


1 Answers

I use bundler to manage gems, so I use

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

to get the tags for gems.

like image 134
Keith Gaddis Avatar answered Oct 01 '22 19:10

Keith Gaddis