Is it possible to set indentation settings in Xcode for each project (or for each file, even)?

Some projects that I use use tab key options that are 3 or 4 places, and the other is the actual tabs. The other mixes the two according to the catalog.

Is there a way to set these options for each project, or even better for each file? If not, does anyone have a smart way to handle this? (except "just remember which setting you should use and change before starting editing")

+50
indentation xcode tabs
Jul 09 '10 at 20:45
source share
7 answers

Update: This answer applies only to Xcode3. For newer versions, see James Turner Answer.

Yes, go to View> Text> Tab Settings ...

Here you specify the settings (prints) that will be saved in the project.

+11
Dec 17 '10 at 9:06
source share

It looks like this has changed using Xcode 4 ... if you click on a file, group or project, among the items in the Utilities panel (by default, on the right) there are "Text Settings".

+62
Oct 28 '11 at 8:27
source share

The accepted answer is no longer correct .. with Xcode 5.1 .., which forces you now to edit the indentation settings for each file through.

enter image description here

enter image description here

+29
Apr 28 '14 at 16:52
source share

You can indent for a file, group, project, or for all new projects, and for all files except the indent, the new source code files will inherit the indent settings of the nearest parent.

To indent each file , select the file in the Project Navigator and set the indent in the File Inspector ▶ Text options .

Xcode indentation per file

To indent each group , select the group in the Project Navigator and set the indent in the File inspector ▶ Text options .

enter image description here

To indent each project , select the project in the Project Navigator and set the indent in the File inspector ▶ Text options .

enter image description here

To set the default indent for new projects , select Xcode ▶ Settings ... ▶ Edit Text ▶ Indent :

enter image description here

+13
Oct 30 '17 at 20:00
source share

In fact, Alex Gray and James Turner are the most correct - Xcode 5.1 allows you to change the tab / indent from File Inspector, as you mention, but just select the whole project and apply it to everything inside it (i.e. all files).

+4
May 20 '14 at 21:21
source share

As of 8.3, you can still select the project in the navigator, and then change the indent tab / space option in the inspector. However, it is worth mentioning that it will only modify files in folders added using Create Groups, instead of Create Folder Links, which is the default.

+1
Aug 18 '17 at 17:34 on
source share

In Xcode 10, you will accomplish this in a manner similar to Alex Gray's earlier approach. This is still done in the File Inspector. Hope this helps!

File inspector

0
Jun 10 '19 at 1:04 on
source share



All Articles