0
votes

vscode: version - 1.40.2

On a normal text type file, type Hello and hit TAB.

All i want is when i hit tab vscode should register 2/4 spaces (what i have configured in the settings.json for the specific language) not a single space.

HelloTAB

Expected: Hello****|
Actual: Hello*|

1

1 Answers

0
votes

Make sure you have unchecked Editor: Detect Indentation. Checking this option will override the Tab Size configuration. E.g. if the opened file has 1 space tab indentation but you have configured a 4 spaces tab indentation - the tab size will be 1 space.

  • Ctrl + , to open Settings.json
  • Enter in "spaces" in search
  • Uncheck Editor: Detect Indentation
  • Leave Editor: Insert spaces checked if you want to insert actual spaces instead of a tab (i.e. you need to do 4 backspaces if you made a mistake). Or unchecked it if you want to insert actual tabs.

Example demo

Also, you can check what is the configured tab size for that particular opened file by looking at the bottom right of your editor:

enter image description here