How can I make the tabs work normally on Xcode 4?

Solution 1:

I use a method similar to franks:

  • In Preferences > Navigation (or Preferences > General in versions of Xcode prior to 5) you can set Optional Navigation to Uses Separate Tab
  • Now opt-clicking a file in the file navigator will open it in a new tab
  • Better yet, opt-clicking links in the code opens the destination file in a new tab

The big feature missing is swapping to an already open tab containing the file if there is one (or staying in the current one).

Solution 2:

UPDATE for 2020:

Finally, almost 10 years later, Xcode 12.x now appears to mostly resolve the issue described here. There is a new Navigation Style option in the Navigation settings panel that controls this behavior.

The behavior has some new quirks/design-choices that seem to make sense, but I'm still getting used to the new experience. For example, a tab will get re-used unless the file in that tab has been edited recently; such a tab is indicated with an italics title.


PREVIOUS ANSWER

I don't think you can currently get the behavior you desire (or I desire). While the tabs work like Safari, they don't work like tabs in other popular IDEs (Visual Studio or Eclipse). And for me this kind of sucks.

In general, I expect IDE tabs to keep more than 1 file open. So if I click a file in the project tree, I expect that it will switch to the tab I have opened with that file - if I have already opened it. Instead, XCode 4 changes the current tab to the file I clicked - making 2 tabs with the same file. Having 2 tabs with the same file is fairly useless.

This forces the user to scan the tab bar first to see if the file is currently opened; if it's not opened then you can look to the project tree. But if you click in the project tree first (which is what I tend to do) then you get punished because you will have just killed a tab.