Vscode: "editor.tabSize" does not change the default indentation

Created on 29 Jul 2016  路  4Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.3.1
  • OS Version: Windows 10.0.10586

Steps to Reproduce:

  1. Set "editor.tabSize": 2
  2. Open a file with two-space width indentation, inserted as spaces
  3. Edit any spot in the code, and the indentation gets forced globally to 4 instead of 2 as the tab width
editor

Most helpful comment

@IceGiant Please also see the setting editor.detectIndentation which is on by default. The editor.tabSize is the fallback value in case detecting indentation is not possible (new file, no indented lines), otherwise the file you open is scanned and an indentation is detected. The detected indentation settings are displayed in the status bar at the bottom, and pressing Tab or indenting will respect the indentation displayed in the status bar.

All 4 comments

@IceGiant Please also see the setting editor.detectIndentation which is on by default. The editor.tabSize is the fallback value in case detecting indentation is not possible (new file, no indented lines), otherwise the file you open is scanned and an indentation is detected. The detected indentation settings are displayed in the status bar at the bottom, and pressing Tab or indenting will respect the indentation displayed in the status bar.

I missed that an extension was overriding the editor global config when editing .js files and had to be separately configured, so that explains why I was running into that.

You can do ctrl+a then shift+tab a few times in the document to unindent everything. Then close and re-open and do alt+shift+f to get the document on the tab size from the settings.

Thanks @toddmo for the solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrkiley picture mrkiley  路  3Comments

villiv picture villiv  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments

chrisdias picture chrisdias  路  3Comments

NikosEfthias picture NikosEfthias  路  3Comments