birgersp
birgersp

Reputation: 4916

Force VSCode to always use tab as indentation

When I save files in VSCode, they are automatically formatted. Tab characters are converted to four spaces. But I prefer tabs. How can I force VSCode to use tab characters instead of four spaces?

These are my settings.

{
    "files.insertFinalNewline": true,
    "terminal.integrated.shellArgs.windows": [
        "-ExecutionPolicy",
        "Bypass"
    ],
    "files.trimFinalNewlines": false,
    "window.zoomLevel": 0,
    "explorer.confirmDelete": false,
    "workbench.startupEditor": "newUntitledFile",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "typescript.format.semicolons": "remove",
    "editor.formatOnSave": true,
    "editor.detectIndentation": false,
    "editor.tabSize": 4,
    "editor.insertSpaces": false
}

What setting am I missing to force VSCode to not replace tab characters with 4 spaces?

Upvotes: 34

Views: 30938

Answers (1)

Richard
Richard

Reputation: 109005

In the settings editor, search for "indent" to find "Editor: insert spaces".

(This can be overridden on a language basis as well.)

Upvotes: 42

Related Questions