Formatting Whitespace in Visual Studio Code Independently
…via the settings.json
Visible Whitespace in the Visual Studio Code Editor
This was extremely important to me personally. The hassle of “where am I” in the empty space between individual code elements… is unnecessary, especially when the code is fresh and not yet indented.
Procedure In Visual Studio Code, open the settings.json file. On Windows, it can be found under: C:\Users\Your_Name\AppData\Roaming\Code\User\settings.json
To make the code snippet valid for all themes, settings, installed languages, etc., precede the code block with:
“editor.renderWhitespace”: “all”,
The small but effective snippet then simply reads:
"editor.renderWhitespace": "all",
"workbench.colorCustomizations": {
"editorWhitespace.foreground": "#dad7d7", // for whitespace
},
Don’t forget the final comma — save — as usual, it takes immediate effect for the entire IDE.
The original article, garnished with additional snippets, can be found at: