TalkingQuickly's Today I Learned

CTags Ruby and Vim

To get jumping to a class definition working in vim when writing ruby, use https://github.com/tmm1/ripper-tags

Out of the box it won't generated nested classes, e.g. Module::Class just Module and Class which will break if you have lots of identically named classes in individual modules. To fix this you need --extra=q so the full command is:

ripper-tags -R --exclude=vendor --exclude=chef --extra=q

You can then use v to enter visual mode after the leading :: of a definition, w to move to the end of it and then ctrl + ] to jump to the definition of a given class.

Looking for help? Each developer at Hashrocket has years of experience working with Ruby applications of all types and sizes. Contact us today and find out how we can help you.