When I'm working with Python I like four space indents, but for JavaScript or HTML I like two space indents.
Today I figured out how to teach VS Code those defaults.
Shift+Command+P
to bring up the action menuPreferences: Configure Language Specific Settings...
itemHTML
or Python
"editor.tabSize": 2
to the corresponding JSON objectI ended up with the following in my JSON (plus a bunch of other stuff I've edited out):
{
"[html]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2
},
"[python]": {
"editor.tabSize": 4,
"editor.wordBasedSuggestions": false
}
}
This file is stored on my machine at ~/Library/Application Support/Code/User/settings.json
.
Created 2021-04-04T10:25:50-07:00, updated 2021-04-04T10:27:56-07:00 · History · Edit