问题
Using Visual Studio Code, is it possible to disable the formatting of a specific file (or extension)?
I try to use some Handlebars templates and I don't want VSCode to format them, at all. A simple example would be :
{{test1}}
{{test2}}
When I save this file (I do have - and want - "editor.formatOnSave" set to true), VsCode transforms the content to
{{test1}} {{test2}}
The only way I found for the file to stay untouched, is to name it "template.txt" instead of "template.hbs".
Any idea?
回答1:
You can add file-specific exclusions like so:
"[handlebars]": { "editor.formatOnSave": false },
来源:https://stackoverflow.com/questions/41781045/vscode-disable-formatting-of-a-specific-file-or-extension