I want the tabs and spaces to be visible in Xcode. Is this possible? I can't find it under preferences.
7 Answers
Editor -> Show Invisibles in Xcode 4

- 4,825
- 4
- 28
- 23
-
5@JavierSedano I've checked around, and it seems there is no reasonable way to achieve what you're asking as of this writing. This is because common characters such as brackets are coupled to the same font color setting as invisibles. – AWrightIV Sep 26 '12 at 07:34
-
I suggest Apple moves settings to the settings pane. Else it's Microsoft or Google. – Anticro Dec 29 '21 at 11:06
In Xcode 7 and later, this command has moved to the Editor menu:
Editor > Show Invisibles
or
Editor > Hide Invisible
Edit
As of Xcode 12.1, the menu item is now simply called Invisibles. It's checked when invisibles are shown, and un-checked when they are not shown.
Further, it looks like Xcode now uses very light blue dots for spaces, and bold light blue dots for the spaces that correspond to your tab positions, which is very nice.
-
6Is it possible to change the characters used to represent the whitespaces and tabs ? Visual studio uses a simple dot which is more viewable than the one used by xcode. – user3279954 Mar 07 '17 at 20:21
-
-
1It looks like newer versions of Xcode use a dot for spaces now (I'm running Xcode 12.1 and spaces show as dots, with every 4th space {when using 4-character space-based indentation} is bold.) – Duncan C Feb 22 '21 at 14:09
You can also use defaults to read/write to the Xcode plist
This is used/tested in Xcode 6.1
GUI
Editor->Show Invisibles
CLI
Turn it on
defaults write com.apple.dt.Xcode DVTTextShowInvisibleCharacters 1
Turn it off
defaults write com.apple.dt.Xcode DVTTextShowInvisibleCharacters 0

- 33,281
- 23
- 160
- 191

- 3,857
- 1
- 27
- 28
It is under Editor -> Invisibles. You can check it to show or uncheck it to hide them.
A note about the macOS
In the mac environment, you can search for any menu option under the Help menu, then it will open the exact menu path you are looking for. For example, searching for invisibles results in this:

- 95,414
- 31
- 268
- 278
In Xcode 6.x and earlier:
View -> Text -> Show Spaces
View -> Text -> Show Control Characters

- 128,072
- 22
- 173
- 272

- 176,835
- 32
- 241
- 292
-
4Thanks. That does show the spaces. Oddly Show control characters is not making the tabs visible. And seeing how XCode shows spaces I may reconsider my desire to use this. :-( – May 17 '09 at 02:25
-
27I⌴agree,⌴it's⌴annoying⌴to⌴read⌴through⌴your⌴code⌴thinking⌴that⌴your⌴font⌴may⌴be⌴missing⌴some⌴characters… – Vince Dec 06 '11 at 11:11
-
You can also enter a white space into the search field, this will highlight all white spaces in yellow temporarily. I found this accidentally here, where Marty asked the other way around: What are these yellow spacers in Xcode?
-
Won't that only match the specific TYPE of whitespace you're searching for? (spaces or tabs or non-breaking spaces, but never all different kinds of white-space) – Duncan C Nov 29 '17 at 16:35
-
1...although you could create a regular expression search that would find all different kinds of whitespace.. – Duncan C Mar 26 '18 at 19:43