Alternatives to Ctags/Cscope with Objective-c?

esiegel picture esiegel · Jun 3, 2010 · Viewed 8.5k times · Source

Are there any alternatives to ctags and cscope with Objective-c support. This does pertain to cocoa development, so inevitably it seems I will be using Xcode (and probably should). I was just wondering what are my Vim options.

Maybe there is some type of plugin system like eclim, but for xcode?

EDIT

So it seems that other than updating ctags to support objective-c, I'm out of luck. Does anyone know if cscope is the same?

Answer

Vincent Guerci picture Vincent Guerci · Apr 26, 2011

a long time after this question, "playing" with vim, I wanted ObjC support, especially with taglist plugin. I found that question, then digged a bit, and here is a not so dirty solution:

  1. An ObjectiveC parser has been added to Exuberant CTags trunk, it is not released (yet?)
  2. You can easily install it on OSX via homebrew:

    $ brew install ctags --HEAD

  3. Note that when using ctags, .m is treated as Matlab and .h is treated as C++. To override, use:

    $ ctags --langmap=ObjectiveC:.m.h

  4. Then I added something like this to my .vimrc for taglist support:

    let tlist_objc_settings = 'ObjectiveC;P:protocols;i:interfaces;types(...)'

    add any type interests you from that list:

    ctags --list-kinds=all
    ObjectiveC
        i  class interface
        I  class implementation
        p  Protocol
        m  Object's method
        c  Class' method
        v  Global variable
        F  Object field
        f  A function
        p  A property
        t  A type alias
        s  A type structure
        e  An enumeration
        M  A preprocessor macro
    

I hope that will help someone!