TextMate - Jumping to Definitions

Tue Sep 05 08:08:00 +0000 2006 (Posted by Tim)

Workflow and Tools
0 Comments

One of my co-workers and colleagues over at Cycling ‘74 dropped me line this morning. Knowing that I use TextMate for much of my C coding on the Mac, he figured that he would give it a try. There is one thing that he immediately missed from Xcode: the ability to select an identifier and have Xcode jump to it’s definition (which is usually in a different file).

After spending a little time, he figured it out. There is a bundle called “ctags” that you can use (bundles is the term that TextMate uses for plug-ins).

First, the easiest way to work with bundles is to download a bundle called GetBundles that can be downloaded.

Then in TextMate (with a document of some kind open) Choose Bundles > GetBundles from the menu. You can get the “CTags” bundle this way.

Now you can select text and then choose Bundles > CTags > Find Tags from the menu (or use the key command) to jump to a definition elsewhere in the code. I changed the shortcut on my machine to cmd-shift-g because that is an old, similar, key command from Code Warrior that I used to use a lot.

Alas, there is a caveat. My co-worker discovered some bugs and problems in the CTags bundle. For simple C projects it works okay as-is. For more complex projects it is broken and doesn’t know where to jump in many cases. He did find at least a partial solution and contacted the developer. Even if it is partially broken, it’s a nice little add-on to have…

Share your own thoughts or comments...

Please log in to leave a comment.

Back to Electoblog Table of Contents