Installing Exuberant CTAGS
The original ctags comes installed by default in OSX. We want ctags-exuberant. The easiest way to install it is to use one of OSXs package managers. I use Homebrew:brew install ctags-exuberant
If this doesn't work, you can install it directly from source by going to the ctags website. At the time of writing this article, the latest is ctags-5.8. Now go to the directory of your download and run the following commands:
tar xzvf ctags-5.8.tar.gz cd ctags-5.8 ./configure make sudo make install
If everything worked, you should be able to see 2 (or possibly more) versions of ctags by typing:
which -a ctags /usr/bin/ctags ==> original ctags /usr/local/bin/ctags ==> exuberant ctags
Tell OSX to use Exuberant CTAGS
Now, we just tell OSX which ctags to use by adding this to your .bash_profile:export PATH="/usr/local/bin:$PATH"
Just open a new terminal and verify that the correct version of ctags is at the top of the list when you run:
which -a ctags /usr/local/bin/ctags ==> exuberant ctags, YAY! /usr/bin/ctags ==> original ctags
Using Exuberant CTAGS in Vim
To use the amazing Ctrl+] functionality in Vim, all you have to do is navigate to your project's root directory and run:
ctags -R .
This will create all the tags files necessary for Vim to use. Now, you can jump around function definitions easily right in Vim!
Resources:
Installing Exuberant CTAGS from source: http://adamyoung.net/Exuberant-Ctags-OS-X/
Thanks a lot. Your instructions were very helpful
ReplyDeletethanks a lot!!!!!
ReplyDeleteNice instructions. Helped a lot.
ReplyDeleteVery easy to install!. Thanks a lot :-)
ReplyDeleteIf you use Mac Ports:
ReplyDeletesudo port install ctags
Thank you! It helps.
ReplyDeletethanks
ReplyDeleteWorks like a charm!
ReplyDeleteThanks a lot, it worked!
ReplyDelete