Vim for iOS: ctags

Xcode has Vim emulation plugins, but you can get by quite nicely with Vim and xcodebuild. If you want better code navigation, however, what do you do? Colin Drake has written an article about using ctags for iOS development:

With implementation files, header files, and the numerous set of frameworks we use to build apps, I’ve always found auto-completion and code navigation to be particularly difficult when writing Objective-C, especially when dealing with larger projects.

To remedy this, I've started using a very old tool, called ctags. ctags is able to parse source code and index methods, functions, classes, etc. for quick access later. Modern versions of Vim are built with ctags support by default, so this makes for a very easy integration.

The article shows you how to get ctags and Vim working for your project files, system headers, and completion with Vim's built in completion and ctrlp.vim. He even includes an alias for the ctags options required to index Objective-C source.

blog comments powered by Disqus