How can Sublime Text show non printable characters (I'm interested in SPACEs and TABs)?
11 Answers
To view whitespace the setting is:
// Set to "none" to turn off drawing white space, "selection" to draw only the
// white space within the selection, and "all" to draw all white space
"draw_white_space": "selection",
You can see it if you go into Preferences->Settings Default. If you edit your user settings (Preferences->Settings - User) and add the line as per below, you should get what you want:
{
"color_scheme": "Packages/Color Scheme - Default/Slush & Poppies.tmTheme",
"font_size": 10,
"draw_white_space": "all"
}
Remember the settings are JSON so no trailing commas.

- 19,721
- 4
- 47
- 52
-
2Is there any way to change the color of white space (dash for tabs) to a little more light? – Mithun Sreedharan Feb 15 '13 at 13:20
-
3@Mithun you should be able to edit the colour scheme to make that change. I'm not sure of the specific colour setting you would have to change, but they are labelled pretty sensibly so you should be able to find it with a bit of playing around. – Andrew Barrett Feb 18 '13 at 10:06
-
3At the beginning of a color scheme, you'll find general settings — background, caret, foreground, etc. The "invisibles" key is the color you want to change. – Roger_S Aug 26 '13 at 15:35
-
2why not remove the color scheme stuff? thanks and upvote anyway! :D – HaveAGuess Jul 16 '15 at 08:15
-
18There's no way to just toggle this from a menu?? Even the simplest text editors have this "feature". – Ciri Nov 26 '15 at 11:22
-
By the way, as of Sublime Text 3 (or perhaps even newer versions of ST2), you *can* have trailing commas. Makes things easier. – Kat Mar 21 '16 at 15:42
In selected text, Space is shown as a middle dot (·
) and Tab as a long dash (—
).

- 36,492
- 15
- 194
- 265

- 14,319
- 3
- 32
- 37
-
6
-
28Which of course makes Ctrl/Cmd+A the fastest way of checking whitespace problems. – iono Jul 11 '13 at 05:03
-
-
1This is SO useful and easy to see! Just press `Ctrl` + `A` to select everything, and voilá! You magically see all the tab and space chars as you described! – Gabriel Staples Dec 02 '21 at 23:28
-
I use Unicode Character Highlighter
, can show whitespaces and some other special characters.
Add this by, Package Control
Install packages, unicode ...

- 620
- 9
- 19
-
It will show up automatically if it finds some of special characters it can detects. – 5ulo Feb 20 '14 at 20:53
If you really only want to see trailing spaces, this ST2 plugin will do the trick: https://github.com/SublimeText/TrailingSpaces

- 9,213
- 3
- 49
- 68
-
-
1I love these little plugins. Super-alt-w highlights spaces in pink. Thanks! – stagl Jan 30 '13 at 21:25
If you want to be able to toggle the display of whitespaces on and off, you can install the HighlightWhitespaces plugin

- 26,978
- 14
- 97
- 115
-
-
1Works fine in Sublime 3, too. Toggle the Whitespace view with Control-Alt-W. – Suzana Oct 13 '16 at 12:13
Here is an Official tutorial of how to do that!
http://sublimetexttips.com/show-whitespace-sublime-text/
just like this!
Hope help for you!

- 10,077
- 1
- 69
- 68
I know this is an old thread, but I like my own plugin that can cycle through whitespace modes (none, selection, and all) via a single shortcut. It also provides menu items under a View | Whitespace menu.
Hopefully people will find this useful - it is used by a lot of people :)
-
This _might_ be regarded as a link-only answer, or a response to a software recommendation, both of which are off-topic. However, it does seem to be helpful, so I'll leave it be `:-)`. – halfer Mar 08 '16 at 20:23
A "quick and dirty" way is to use the find function and activate regular expressions.
Then just search for : \s for highlighting spaces \t for tabs \n for new-lines etc.

- 39
- 1
-
Actually "\s" is for all whitespace. For space only, escape the space character, "\ " – eldorz Sep 01 '19 at 23:12
http://sublimetexttips.com/show-whitespace-sublime-text/
- open
Ctrl+Shift+P
- search
Preferences: Settings –> User
- just paste below codes
{
"draw_white_space": "all",
"translate_tabs_to_spaces": true
}
I've several plugins (including Unicode Character Highlighter), but the only one which found the character that was hiding from me today was Highlighter.
You can test to see if it's working by pasting in the text from the readme.
For reference, the character causing me trouble was
.
For a sanity check, tap your right arrow key over a range of text containing an invisible character, and you'll need to right-arrow twice to move past the character.
I'm also using the following custom regex string (which I don't fully grok):
{
// there's an extra range in use [^\\x00-\\x7F]
// also, don't highlight spaces at the end of the line (my settings take care of that)
"highlighter_regex": "(\t+ +)|( +\t+)|[^\\x00-\\x7F]|[\u2026\u2018\u2019\u201c\u201d\u2013\u2014]"
}

- 14,902
- 10
- 83
- 103
-
-
...and whilst I think of it, as another sanity check is http://linux.die.net/man/1/xxd. On the terminal, type `xxd`, enter, then paste your string – ptim Jul 18 '16 at 07:07