Mandatory screenshot:

Is there a way to replicate this behavior? I am currently working with big painful CSV files (Excel or CSVEasy are not options), and seeing all the characters is invaluable here.
Thanks for your help.
Only for spaces (as dots) and tabs (as horizontal line)
Preferences -> Settings - User"draw_white_space": "all",
Additional nugget: how can I bind toggling draw_white_space to a shortcut? Using some examples, I tried adding the following line to my keymap, but it doesn't toggle, it just toggles once, but re-pressing the shortcut doesn't produce anything:
{ "keys": ["alt+d"], "command": "toggle_setting", "args": {"setting": "draw_white_space"} },
Maybe I should specify to the toggle_setting commang the values to toggle between? But how can I do that? Also, how did you find the existence of the draw_white_space command? And how can I find the values accepted by the command?
Thanks for the help!
{ "keys": ["shift+alt+d"], "command": "set_setting", "args":
{
"setting": "draw_white_space",
"value": "all"
}
},
{ "keys": ["shift+alt+a"], "command": "set_setting", "args":
{
"setting": "draw_white_space",
"value": "selection"
}
},
Also, how did you find the existence of the draw_white_space command?reading Preferences -> Settings - Default
And how can I find the values accepted by the command?
explore KeyBindings file, or try to find command source code in ST2 Packages in *.py files
also try to write Sublim plugin, and you will learn more about ST2
The solved problem aside, I'd really like to "see" the line ending characters in some cases.
And I, among the small number of people working in languages that don't put spaces between words, would like to be able to see the zero-width space (aka ZWSP), Unicode U+200B.
import sublime_plugin
class ShowZeroWidthSpace(sublime_plugin.EventListener):
def on_modified(self, view):
spaces = []
p = 0
while 1:
s = view.find(u'\u200b', p + 1)
if not s:
break
spaces.append(s)
p = s.a
if spaces:
view.add_regions("zero-width", spaces, "string")
else:
view.erase_regions("zero-width")
@FichteFoll,
I'm not sure how this works — is it actually inserting a regular space when it finds a ZWSP?
Thanks for providing this!
No, it just marks ZWSP characters with add_regions. Precisely, it paints their backgrounds but since they have zero width it just inserts a line in your string color. Just make sure that you fix the indentation and unindent after "break" because userecho messed up indentation and this is crutial with Python.
Version without the indentation messed up: https://pastebin.com/ehWxNfMe
I would like to recommend adding showing the CR and LF line-ending characters as well with draw_white_space. Or add a new setting for draw_white_space_lineendings.
Although you can choose your line-endings type you want in the Menu - it is nice to be able to see it quickly visually - or to see if a file may be using mixed line-ending types.
I agree with this, it would be a nice feature.