question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to tabSize = 4 please

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
NobbZcommented, Aug 10, 2021

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.

1reaction
NobbZcommented, Aug 9, 2021

This option is provided by VScode and not “removable”.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found