Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Visual Studio Code insert spaces when editing a Makefile and "editor.insertSpaces": "auto"?

make doesn't like spaces for the body of a target in a Makefile. Has to be a tab.

I changed "editor.insertSpaces" to "auto", thinking this would help. It didn't.

I had to set it to false in order to get the code working.

like image 528
Carmine Rimi Avatar asked Jan 22 '16 00:01

Carmine Rimi


1 Answers

This is now possible with Language Specific Settings. https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings

To customize your editor by language, run the global command Preferences: Configure Language Specific Settings (command id: workbench.action.configureLanguageBasedSettings) from the Command Palette (⇧⌘P) which opens the language picker. Selecting the language you want, opens the Settings editor with the language entry where you can add applicable settings.

Once you have the editor open, enter the following configuration for [makefile]

{
    "[makefile]": {
        "editor.insertSpaces": false,
        "editor.detectIndentation": false
    }
}
like image 111
Loren Avatar answered Sep 20 '22 19:09

Loren