VSCODE seems to be inserting spaces everywhere in my html code. I checked the settings and it's the following which is causing it: "editor.formatOnSave": true
Example:
How do I configure this to stop inserting spaces?
VSCODE seems to be inserting spaces everywhere in my html code. I checked the settings and it's the following which is causing it: "editor.formatOnSave": true
Example:
How do I configure this to stop inserting spaces?
I have the following set :
"editor.formatOnSave": false,
"editor.insertSpaces": false
Now it is not inserting spaces. Hope it helps
Mine was caused by an extension JS/ CSS formatter, after i uninstalled and restart vscode works great. After spending hours wondering why my django static links are broken smh
When saving, Visual Studio inserted a lot of spaces. This happened after an update of Visual Studio. This problem was because of an extension called Bracket Pair Colorizer
. What I did was, uninstall and reinstall, and that solved the problem. I suggest to check all your extensions. It could be one of them.
I disabled the option of HTML formatting and no more space when saving files.
Settings > Extensions > HTML > Format: Enable
Enable/disable default HTML formatter.
What was the case with me is that I had the option Editor: Format on save mode
to be set to file
, this in combination with format on save would mean VS Code will try to format the entire file, resulting in spaces as defined in the formatter.
Change this to be modifictions
, and VS Code will only save the lines you have made changes in.
Now vscode has option
"editor.formatOnSaveMode": "modificationsIfAvailable"
It will not reformat whole file on save, modified content will be formatted (given source control is present)