Setting up ctags is simple, now that we have homebrew:
brew install ctags
That’s it. Viva la brew!
Now go back to your rails project in Vim and issue the
Whoops, that didn’t go as planned. You are probably seeing something like this:
invalid flag -- -R
What the heck I just installed ctags via brew, didn’t I? Well yes you did. The problem is that OSX has ctags installed already and is command blocking your awesome ctags implementation (which is actually exuberant tags).
If you were to issue the ctags command alone in the terminal you will see something like this:
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
That means you are still accessing the original ctags implementation on OSX. Turns out this is a simple fix. Just rename the
ctags command in
sudo mv /usr/bin/ctags /usr/bin/ctags_orig
Now if you reload your terminal or open a new window and initiate the
ctags command, you should see something like this:
ctags: No files specified. Try "ctags --help".
Now you’re in business! Go back to your rails project in Vim and run the
:Rtags command again. Now it should appear that the command completed. Give it a try. Go search for one of your methods. With the cursor on something you want to find, press