How to tabSize = 4 please
See original GitHub issueI normally work on vim with the tab width set to 4. I recently just open vscode to do some refactoring and every file that was touched had their indentations changed to 2 spaces. I thought knew how to setup tabSize in vscode and even how to set it per workspace and per language this is part of my vs code settings.json file
{
"editor.formatOnSave": true,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.wordBasedSuggestions": false,
"editor.formatOnType": true,
"editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"[elixir]": {
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.formatOnType": true,
"editor.wordBasedSuggestions": false,
"editor.trimAutoWhitespace": false,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true
}
}
The final fix was to set editor.formatOnSave
to false
Question: can i use MY preferred tab width with this plugin, or is there something more i need to do?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How can I define tab size to 4 in ESLint? - Stack Overflow
See here for an example of a related discussion. VSCode does have a setting for the visual size of tabs, though: go to...
Read more >VS Code tips — Indentation settings and the ... - YouTube
VS Code shows the indentation settings for the current in the status bar. Click on this entry to quickly change the tab size...
Read more >Editor indent size using 4 when it's set to 2 #48440 - GitHub
Issue Type: Bug. The editor is now using an indent size of 4 even though editor.tabSize is set to 2. VS Code version:...
Read more >Tabs and Indents are 2 spaces despite setting at 4 spaces
Tabs come out at 2 spaces when I hit TAB or Enter, not 4 spaces. I cannot find anywhere in the Settings where...
Read more >tab-size - CSS: Cascading Style Sheets - MDN Web Docs
The tab-size CSS property is used to customize the width of tab characters ... pre { tab-size: 4; /* Set tab size to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As I said already, the option is editable and VScode adheres to it. And if you do not format your code, then there will be nothing that destroys your beloved 4 spaces indent…
Also, setting it to 2 by default, makes it match the formatter and therefore the decreases clutter during format on save.
This option is provided by VScode and not “removable”.