You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change the editor fallback defaults to insertSpaces: true, tabSize: 4 #498
I don't have a preference setting about spaces vs tabs. When I open .travis.yml, VSCode always uses tabs instead of spaces to create new indentation. This is very problematic since YAML files forbid tabs.
I thought the editor would automatically figure out the indentation to use?
// Place your settings in this file to overwrite default and user settings.
{
"editor.insertSpaces": false, // <---- THIS IS THE ONE
"files.trimTrailingWhitespace": true,
...
}
The settings get applied by the workbench to each editor regardless the model being for an empty file or not. If this setting is left out, then the model is used for guessing. If the guessing code is not confident, it falls back to insertSpaces:false, tabSize:4. The fallback values have no configuration story.
I think our intent here is to say: "all TypeScript, CSS and JS files should use tabs". This sounds to me as a great usecase for .editorconfig
Is there any mode specific configuration instead? YAML actually banned tabs, so our editor putting one in there is just wrong. That is true for our project as it is for every user out there writing YAML.
I've run into this too, I want the behavior of auto but fallback to space, not tab. Not sure if atom does anything special here or just falls back to space by default.
changed the title [-]Editor inserts tabs instead of spaces for indentation[/-][+]Change the editor fallback defaults to insertSpaces: true, tabSize: 4[/+]on Nov 25, 2015
Activity
alexdima commentedon Nov 23, 2015
João Moreno (@joaomoreno)
Our project settings force the insertion of tabs:
.vscode/settings.jsonjoaomoreno commentedon Nov 23, 2015
Should this only act on when there is no definite hint about the file's indentation? E.g.: new files.
alexdima commentedon Nov 23, 2015
The settings get applied by the workbench to each editor regardless the model being for an empty file or not. If this setting is left out, then the model is used for guessing. If the guessing code is not confident, it falls back to insertSpaces:false, tabSize:4. The fallback values have no configuration story.
I think our intent here is to say: "all TypeScript, CSS and JS files should use tabs". This sounds to me as a great usecase for .editorconfig
joaomoreno commentedon Nov 23, 2015
Is there any mode specific configuration instead? YAML actually banned tabs, so our editor putting one in there is just wrong. That is true for our project as it is for every user out there writing YAML.
Tyriar commentedon Nov 23, 2015
I've run into this too, I want the behavior of
autobut fallback to space, not tab. Not sure if atom does anything special here or just falls back to space by default.hashhar commentedon Nov 24, 2015
For those wondering, Atom also falls back, but to spaces.
Spaces is a better option because almost all compilers support spaces.
alexdima commentedon Nov 24, 2015
I'm ok with changing the fallback values, I especially like the reasoning that all compilers support spaces.
So the action out of this issue is to change the fallback defaults to
insertSpaces: true, tabSize: 4[-]Editor inserts tabs instead of spaces for indentation[/-][+]Change the editor fallback defaults to insertSpaces: true, tabSize: 4[/+]