Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 834
birgersp Avatar asked Nov 26 '19 09:11

birgersp


1 Answers

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

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

like image 194
Richard Avatar answered Nov 16 '22 06:11

Richard