Sublime Text 2 - View whitespace characters

SublimetextSublimetext2

Sublimetext Problem Overview


How can Sublime Text show non printable characters (I'm interested in SPACEs and TABs)?

Sublimetext Solutions


Solution 1 - Sublimetext

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.

Solution 2 - Sublimetext

In selected text, Space is shown as a middle dot (·) and Tab as a long dash ().

Solution 3 - Sublimetext

I use Unicode Character Highlighter, can show whitespaces and some other special characters.

Add this by, Package Control

Install packages, unicode ...

Solution 4 - Sublimetext

If you really only want to see trailing spaces, this ST2 plugin will do the trick: https://github.com/SublimeText/TrailingSpaces

Solution 5 - Sublimetext

If you want to be able to toggle the display of whitespaces on and off, you can install the HighlightWhitespaces plugin

Solution 6 - Sublimetext

Here is an Official tutorial of how to do that!
http://sublimetexttips.com/show-whitespace-sublime-text/

> just like this!

enter image description here
enter image description here

Hope help for you!

Solution 7 - Sublimetext

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 :)

Solution 8 - Sublimetext

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.

Solution 9 - Sublimetext

http://sublimetexttips.com/show-whitespace-sublime-text/

  1. open

Ctrl+Shift+P

  1. search

> Preferences: Settings –> User

  1. just paste below codes

{
    "draw_white_space": "all",
    "translate_tabs_to_spaces": true
}

Solution 10 - Sublimetext

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]"
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionimkostView Question on Stackoverflow
Solution 1 - SublimetextAndrew BarrettView Answer on Stackoverflow
Solution 2 - SublimetextPavel HodekView Answer on Stackoverflow
Solution 3 - SublimetextstaticorView Answer on Stackoverflow
Solution 4 - SublimetextthomaxView Answer on Stackoverflow
Solution 5 - SublimetextchiborgView Answer on Stackoverflow
Solution 6 - SublimetextxgqfrmsView Answer on Stackoverflow
Solution 7 - SublimetextkodybrownView Answer on Stackoverflow
Solution 8 - SublimetextDamoclesView Answer on Stackoverflow
Solution 9 - Sublimetextuser8629798View Answer on Stackoverflow
Solution 10 - SublimetextptimView Answer on Stackoverflow