WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

Setting up and using VIMs Exuberant CTAGS on OSX (MAC)

Submitted by barnettech on Mon, 10/28/2013 - 15:45

Assuming you have macports install you first type:

port install ctags

Then you generate a ctags file in the root of your Drupal project by typing in:

ctags --langmap=php:.engine.inc.module.theme.install.php --php-kinds=cdfi --languages=php --recurse

type in the following in vim to tell vim to look in the current directory for a tags file and then the parent, and then recursively continue until a tags file is found.

:set tags=./tags; 

Now type in ctrl-] on any function or class name and it will take you to the definition

cntrl-t will get you back to where you came from.

typing in :ta drupal_add_js will take you to the definition of drupal_add_js

More great reading on ctags at:  http://vim.wikia.com/wiki/Browsing_programs_with_tagshttp://andrewradev.com/2011/06/08/vim-and-ctags/