views:

334

answers:

3

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?

+1  A: 

AFAIK, ctags support you to define some rules for a new language, I did that when I did some development using laszlo(similiar to flex). You can read the manpage of ctags to get more details, that is not hard to do.

I find there is a vim filetype plugin that support development under cocoa here, hope it is helpful for you.

Vincent
A: 

There is an option to use ctags for objective-c. You can use etags in ctags mode. etags derived from ctags some time ago, and in its source code ctags compatible tags will be generated by defining a certain macro switch.

In fact the man page in Mac Os already documents etags and ctags in the same page. It states that objective-c is supported in ctags. You should be able to generate a tag file using the following command: ctags -l objc *.[mh]

Unfortunately the ctags program in Mac OS behaves not as documented since Apple messed it up. I however managed to install this kind of ctags using Ubuntu Linux and it works great!!! There you have to install the emacs22-bin-common package.

So under Mac OS all you have to do is to compile this package for yourself.

  • Download the corresponding source package e.g. from the Debian server (link).
  • exctract it and change to the source directory
  • run ./configure
  • configure returns with an error because it cannot find lispref
  • I deleted all targets in varible config_files in the created file config.status despite the ones with lib-src
  • run ./config.status
  • cd lib-src
  • make
  • Copy ctags e.g. to /usr/local/bin and change permissions
    • sudo cp ctags /usr/local/bin
    • chmod a+rx /usr/local/bin/ctags

You are done. Happy tagging!!!

Harry Hacker
A: 

Apropos the other answer: you can install EMACS with MacPorts fairly easily and it will include a version of etags at /opt/local/bin that has Objective-C support compiled in.

% sudo port install emacs
% find . -name ‘*.[hm]’ -print0 | xargs −0 /opt/local/bin/etags

And then inside vim:

:setlocal tags=TAGS

This works well for me with MacVim.

Seth Kingsley
But will etags create a suitable tags file to work with VIM. I'm crippled in Emacs
esiegel
Yes. I don’t use EMACS, and only use vi, vim, or MacVim.
Seth Kingsley