使用Objective-c替代Ctags/Cscope吗? [英] Alternatives to Ctags/Cscope with Objective-c?

查看:199
本文介绍了使用Objective-c替代Ctags/Cscope吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有其他支持Objective-c的ctags和cscope替代方案.这确实与可可粉的开发有关,因此不可避免地,我似乎将使用Xcode(可能应该使用).我只是想知道我的Vim选项是什么.

也许有某种类型的插件系统,例如eclim,但适用于xcode?

编辑

因此,除了更新ctags以支持Objective-c之外,我似乎还很走运.有人知道cscope是否相同吗?

解决方案

很久以后,这个问题,用vim播放 ,我希望得到ObjC支持,尤其是标签列表插件.我找到了这个问题,然后进行了深入研究,这是一个不太脏的解决方案:

  1. ObjectiveC解析器已添加到旺盛的CTags干线" ,它还没有发布(还吗?)
  2. 您可以通过自制程序轻松地将其安装在OSX上:

    $ brew install ctags --HEAD

  3. 请注意,使用ctags时,将.m视为Matlab,将.h视为C ++.要覆盖,请使用:

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

  4. 然后我在.vimrc中添加了类似内容,以支持标签列表:

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

    从列表中添加您感兴趣的任何类型:

    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
    

我希望能对某人有所帮助!

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?

解决方案

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!

这篇关于使用Objective-c替代Ctags/Cscope吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆