Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 file indentation: How to set 2 spaces as default configuration?

Tags:

xcode

xcode8

I am trying to set the default indentation and tabs in Xcode 8.x to 2 spaces

In the utilities I changes the default values from 4 to 2

Xcode Text Settings screenshot

However nothing has changed. Did I miss something?

like image 665
agusgambina Avatar asked Nov 04 '16 13:11

agusgambina


2 Answers

You have to go to every file and then to Ctrl + A then Ctrl + I which will indent the file with the two spaces. That setting does not touch files already created in the project.

like image 153
darren102 Avatar answered Sep 28 '22 09:09

darren102


If you want to do this for all projects, you can set this globally in the Text Editing / Indentation preferences:

Text Editing / Indentation

like image 39
Mike Swingler Avatar answered Sep 28 '22 09:09

Mike Swingler