I would like to configure the vscode to format my JSON objects with 2 spaces of indent, not 4 as it does by default. How can I do this?
Configure vscode json formatting spaces
Asked Answered
Paste in this lines in settings.json in VSCode, and you're all set:
"[json]": {
"editor.insertSpaces": true,
"editor.tabSize": 2
}
@JonathanPool I do not know why. I ti works for project settings.json in
.vscode/settings.json
and in global settings.json ~/.config/Code/User/settings.json
–
Theotheobald Install the editor config plugin.
ext install EditorConfig
Add an .editorconfig
file to your project root with the following:
[*.json]
indent_style = space
indent_size = 2
See also:
© 2022 - 2024 — McMap. All rights reserved.
[python]
you should be able to use[json]
. – Telangiectasis