Reputation: 34489
I want to have VSCode indent C files by 2 spaces by default. Is it possible to do this? Thanks.
Upvotes: 4
Views: 8067
Reputation: 180641
Adding to @Batman's answer after you amended your question via a comment (since this is too long to put into a comment): look into "configure language-specific settings..." in your command palette. It'll create
"[c]": {}
at the bottom of your settings.json so you can add anything there like:
"[c]": {
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
}
and that will only affect C files.
Upvotes: 4
Reputation: 1276
File > Preferences > Settings
Below Setting worked for me
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
Upvotes: 1