TextMate and Xcode

Fri, Jun 27

I’ve been spending time getting familiar with Xcode as I learn to write applications in Objective-C, with the larger goal of writing applications for iPhone. My editor of choice on the Mac up to this point, is TextMate, an great all around code editor. I’ve written a number of tutorials/tips on TextMate on this blog (check out the TextMate Category for links).

One of the things I’ve become quite accustomed to is tabbed based user interfaces. For example, in FireFox I typically have a screenful of open tabs. When working with projects inside of TextMate, you can have multiple source code files open in tabs. Unfortunately, this is not a feature supported in Xcode (that I am aware of).

So, I spent a few minutes poking around at various options and came up with an approach that is far from perfect, yet offers a blend of coding in TextMate and managing compiles/builds in Xcode. Not perfect, however, it’s working for me.

Click on the image below to learn more.


Thank you very much for this excellent tip. XCode not having a tabbed interface is a real annoyance but this approach works fairly good and is much more productive than constantly switching between files.

Keep up the good work…

by Patrick on Jun 27, 2008. #

You can use “tabs” in XCode, it is just not as intuitive as you would expect from Apple. In the upper left corner there is a list of files that are open in the current window, you can use Option+Apple+Left and Right to flip between the files open in that window. As with all OS X applications you can switch between the current windows open in an application using Apple+`

It isn’t as nice as TextMate’s tab system (or even more addicting Apple+T “Go To File”) so if you are a keyboard shortcut addict, TextMate should still be your primary editor.

by Erik Karulf on Jun 27, 2008. #

Why not using the xcode bundle in textmate ?

You can use the import project command and TextMate create a project for you.

You can then build and run with cmd+B and cmd+R.

I usually open a project in xcode and textmate, but I use xcode only for the project management aspect and debugging.

XCode seems quite cool, but sor far, nothing can beat TextMate bundle system.

by David Bourguignon on Jun 27, 2008. #


Thanks for the comment. I’ve tried the bundle and you are right, it’s works well.

One aspect that I really like about using Xcode is the integration of compiling, running and debugging.

My approach may not be for everyone, however, if nothing else it (once again) demonstrates how flexible TextMate is and that it can provide different things to different people.


by john on Jun 27, 2008. #

While TextMate looks nice to use; however, I am a Vi editor at heart. Nothing beats the ability to move around and edit as fast in a Vi environment.

MacVim is the preferred Vi editor and truly love it as it does support tabs as well.

I can use MacVim to edit Xcode files but code-completion is what is lacking here. I wonder if it’s the same for TextMate? From the sounds of it, it supports code-completion?


by Chad W. Taylor on Aug 3, 2008. #

Hi Chad,

it doesn’t have code completion in the sense of an IDE but there are a lot of tab-trigger snippets and a rudimentary code completion via ?+ESCAPE.


by Patrick on Aug 4, 2008. #

In the video you are saying that you are going up one level in folder structure to drop the folder onto TextMate’s icon.
Here’s a little timesafer: You can click the top of a finder window (the little blue folder) and then drag that one onto TM’s icon. :)

by Zettt on Aug 15, 2008. #

I would like to know where I can found the autocomplete with Textmate. In fact, I would like to find the same as in Xcode. Can you help me please ?

Thank you !

by kitiz on Aug 19, 2008. #

Another time saver for getting the folder in to text mate without needing the finder at all…

In xCode, “command click” on the project name or project icon at the top of the xCode window. You’ll be given a drop down list of icons from that file, through the enclosing folders, right up to your machine’s root. You can take any of those folders or files and simply drag it off in to xCode, or should you wish, click on it to open it up.

This is a standard feature of OS X applications (I guess part of the document based application framework) but hardly anyone seems to know about it!


by Benjohn on Apr 16, 2009. #

auto complete is alt and escape and u can index the header files for a class from the objective-c bundle menu now for sdk classes and custom classes

by ssmithtone on May 24, 2009. #

I love vi too. So when in Textmate, I use the Vi plugin.
IMPORTANT — I’ve learned to use the Vi shortcuts and Emacs and Textmate shortcuts, so I’m really using three editors’ shortcuts at the same time. A bit confusing, but using Emacs shortcuts and save time when you are in insert mode in Vi. Using Textmate shortcuts like Apple + L to goto a line b/c the Vi version doesn’t work in the plugin.

Does anyone know how to disable the vi textmate plugin so I can use esc to finish completions?

by Slusser on Jul 2, 2009. #

Thanks for the tip! Very helpful!

by Tiago on Apr 26, 2010. #