Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set per-filetype tab size?

People also ask

How do you set tab size or code?

Type “Indentation” into the search field then head to the “Editor: Tab Size” section. Replace the default space number with your preferred one: Your setting will be applied and reflected immediately. If this doesn't happen (it's a little lag sometimes), just reload or restart your VS Code.

What is the best tab size?

Tablets that feature 7-inch or 8-inch screens are best for portability. These small devices usually weigh in under a pound and easily slip into purses or bookbags without much thought and without much weight being added. Seven-inch tablets are also the most affordable — several models come in under $100.

What is tab size in VS code?

By default, VS Code inserts spaces and uses 4 spaces per Tab key.


VS Code configures language specific settings in settings.json

  • Shortcut is: Command Palette (⇧⌘P) then: Preferences: Configure Language Specific Settings

Example of setting.json changing tabsize

{
    "[sass]": {
        "editor.tabSize": 2
    },
    "[html]": {
        "editor.tabSize": 4
    },
    "[javascript]": {
        "editor.tabSize": 2
    }
}

These are not nested inside any other object, they are defined at the root.


With vscode v1.63 you will be able to "group" languages in language-specific settings like this:

"[sass][javascript]": {
    "editor.tabSize": 2
},
"[html]": {
    "editor.tabSize": 4
}

This already can be done in the colorCustomizations setting like:

"workbench.colorCustomizations": {
    "[GitHub Sharp][GitHub Sharp Dark]": {
       "editorPane.background": "#d6d0d01a",
       "sideBarSectionHeader.border": "#D3D3D3",
    }
}

See Multiple languages specific editor settings