I’m not fond of the indentation guides in VS Code and find them distracting, except in HTML where they are necessary.
I know that I can disable them for all files by adding "editor.guides.indentation": false
to settings.json, but is there any way of disabling them for all files but HTML files?
2
Answers
To change the indentation based on programming language:
Open the Command Palette (CtrlShiftP | macOS: ⇧⌘P).
Type and select: Preferences: Configure Language Specific Settings… (command id: workbench.action.configureLanguageBasedSettings).
Select a programming language (for example TypeScript).
If Settings menu is opened (since 1.66.0):
4. Press → to place the cursor right beside the language filter (e.g. @lang:typescript).
5. Type Tab Size and enter your preferred value in the text box.
If settings.json file is opened:
4. Add this code:
See also: VS Code Docs
Reference => https://stackoverflow.com/a/45671704/12828696
In settings.json:
See also https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings.