Using ctags with MacVim for Objective C on OS X

Boon aka Hwee-Boon Yar January 12, 2011
Source
  1. Install Homebrew if you haven't.
  2. Run brew install ctags. The version of ctags that ship of OS X is an antique.
  3. Run echo "--langdef=objc" >> ~/.ctags && echo "--langmap=objc:.m" >> ~/.ctags && echo "--regex-objc=/^[\t ](-|+)[\t ]([_a-zA-Z0-9][_a-zA-Z0-9])([_a-zA-Z0-9][_a-zA-Z0-9])/\2/f/" >> ~/.ctags
  4. cd to the directory to write the tags file in
  5. Run ctags -R mytargetdirectory
  6. Press ^] in MacVim over a function name to go to declaration/definitions

PS: Creating the .ctags file is so convoluted because I can't figure out how to put a multiliner without ruining the formatting in the instructions.

Discussion in the ATmosphere

Loading comments...