How can I make tabs work fine on Xcode 4?

Xcode finally added tabs, but the problem is that they behave very weird. For example, they will keep a tab open only if it was open for a new tab.

If you open a file by simply clicking in the project tree, Xcode will close your tab as soon as you click another file in the tree.

Is it possible to make them behave like real tabs and prevent them from reusing Xcode? How?

+85
xcode xcode4
Mar 18 2018-11-18T00:
source share
12 answers

I do not think that you can get the desired behavior (or I wish). Although tabs work like Safari, they don't work like tabs in other popular IDEs (Visual Studio or Eclipse). And for me it sucks.

In general, I expect IDE tabs to contain more than one file. Therefore, if I click on a file in the project tree, I expect it to switch to the tab that I opened with this file - if I already opened it. Instead, Xcode 4 changes the current tab to the file I clicked - making 2 tabs with the same file. Having two tabs with the same file is useless.

This forces the user to first scan the tab bar to see if the file is open; if it does not open, you can see the project tree. But if you first click on the project tree (which I do), you will get punished because you just killed the tab.

+66
Mar 25 '11 at 6:23
source share

I use a method similar to franks:

  • In Settings> Navigation (or Preferences> General in Xcode versions up to 5) you can set optional navigation to use a separate tab
  • Now, clicking on the file in the file navigator, you will open it in a new tab
  • Even better, clicking the links in the code opens the destination file in a new tab

Lack of a large function - switching to an already open tab containing a file, if it exists (or remains in the current one).

+88
Jul 12 2018-11-12T00:
source share

This is not really an answer, because it contains a solution; I basically just want to join the fight. But you will feel better and prove that Apple is wrong. :)

The problem with Xcode 4 tab implementations is that Apple implemented them as workspace tabs . In other words, creating a new tab essentially creates a new workspace, each with its own sub-pandas with their configurations, etc. In fact, this is a whole environment on each tab. There are a number of problems with this choice.

This differs from most file file implementations by IDE / text editors, in which the tab (usually) is a single file and each file has its own tab.

The problem with workspace tabs is that there are only so many different different workspaces that we could extract from this, severely limiting the actual use of tabs in this way. In addition, additional workspaces simply become a responsibility, introducing more things that the application user must take care of himself: for example, what kind of navigator is, what editor mode is active (standard, assistant, version), regardless of whether the debug console is open, etc. .d. etc. Suddenly switching to a new tab means that now you need to worry about returning the environment to the form you need, because there is a good chance that the other tab has not been left in the state that you expect to find it. This actually discourages the use of tabs because it introduces more work into the workflow.

Bookmarks for files do not have this problem (apart from special cases, such as split viewports), because all the changes are the file you are looking at, and not your entire environment. Moreover, if they are executed correctly, the file tabs work fine as a direct history, allowing you to quickly return to a file that has been processed recently, without much effort. The only way to do this in Xcode is to explicitly set up a new tab environment for each file that you want to work with, but you must be careful not to change the file on this tab, or your file will suddenly be lost: again, more work for the user .

Workspace tabs are also significantly heavier than file tabs, because there is much more to remember, and switching workspaces requires much more than switching files.

The truth (and I think most will agree with me on this), to the developer, file tabs are much more useful than workspace tabs, and since Xcode still lacks the correct implementation of this function, which many consider the basic required functions in the IDE / editor.

+20
Mar 19 '13 at 21:19
source share

Well, not a real answer, but my personal workaround. The real problem for me is that the file opened on the tab is easily deleted in xcode 4. Finding the file again can take a lot of time, so I like them to be on the tab and stay there.

I solved this (somehow) for me by pinpointing the actions that I am doing that make the tab switch to another file and replace them with equivalent actions that open a new tab.

  • Instead of clicking on a file once in the navigator, I always double-click the button I set to open a new tab
  • In most cases, I do not use the navigator, since on each tab it has a different state of open and closed folders. Not good for me. So I switched to Option βŒ₯ Command ⌘ O. When I open a file from this list, I save Shift Option βŒ₯ . In the small window that appears, I select the "new tab".
  • When I click on the links in the code, I also press Shift Option βŒ₯ Command ⌘ and open in a new tab.

I save two fixed tabs for editing the target parameters and viewing the assembly results. I completely turned off automatic tab switching in prefs because I noticed that it distracted me a lot.

I would really like to get something like the xcode 3 panel in xcode 4, it was so easy to use.

+17
Jun 04 2018-11-11T00:
source share

Xcode->Preferences->General->Double Click Navigation and in the list select Uses Separate Tab .

+17
Jun 14 2018-12-12T00:
source share

I assume that my answer will not appear for a while, but if you want this to work as a visual studio or intellij (or at least closer)

Settings-> General-> Double-click Navigation-> Uses a separate tab

Double-clicking on a file will stop opening it in a new window and open it in a new tab.

The loner is still dumb and takes the top tab. But if you get used to double-clicking (I already was), this will save you some headaches. I suppose.

+7
Jun 08 '13 at 17:47
source share

I absolutely hate how tabs work in Xcode. However, the only workaround I found worthy is to use the OSX tab shortcuts: CTRL + CMD + β†’ CTRL + CMD + <-

+4
Jun 27 2018-12-12T00:
source share

I found my way in Preferences-Behaviors!

At first I hated Xcode 4 for the issues discussed here, mainly because debugging information continued to open new files on tabs and change the navigator

in Behaviors you can define the Debug tab and make the Run and Build run differently. on the Debug tab, I give more space to the navigators on the left and bottom

for similar reasons, I also have a Search tab

other tabs are for the files I am writing to. I run them with .h, which is usually small enough, so I only need one view, and then with one click in navegator I open 2-3 versions. cpp, so I can install them in the places where the last hot spots in the file are located. then I close the navigators on these tabs

this does not invalidate the care and tricks given in the other answers here, but makes them much less difficult

happy coding!

+3
Apr 18 2018-12-18T00:
source share

I learned that when you click option aka alt when opening files in the navigator, you will go to the already open tab with the file and a new tab will open if it is not already open.

This method also works when opening files with cmd shift - O and opening sentences with option - enter instead of just enter ...

Now, if there is some way to do this by default, i.e. the need to constantly press option all the time will be deleted, this will be a big step forward.

I also use Behaviors to prevent my tabs from coming back after tests or build failures.

(Like other people, I totally don't understand the behavior of the Xcode tab. Apple should take a look at IntelliJ ...)

+2
Sep 13 '14 at 9:32
source share

xcode tab bar so suck, I think Apple should improve the tab navigation function to avoid following 3 points. 1. Double-click the file so xcode opens another tab, if it was already there. 2. for more tabs, the tab will become small and therefore I don’t know which file on the tab, I want the tab to display the full name 3. for even more tabs, the new tabs will be hidden, and not two rows of tabs. I want to show two rows of tab bars.

+1
Jan 11 '14 at 12:07
source share

Tabs in Xcode 4 work like tabs in other places on Mac OS X, such as Safari and Terminal.

0
Mar 20 '11 at 9:28
source share

If you have the tab bar turned on (the Show / Show Tab bar) and you double-click the file, it will appear in its own window with one tab ( . Make sure the tab bar is turned on both in the new and old (main) windows ).

Now you only need to drag this new window from your tab and transfer it to the tab bar in the main window.

enter image description here

It will remain docked as a separate tab, showing this file.

To change the file in this new tab, open Project / Reveal in the Project Navigator , which will open the project navigator on the left.

0
Sep 19 '12 at 15:07
source share



All Articles