Written by

Senior Product Engineer at George James Software
Article John Murray · Jan 29, 2021 1m read

How to make new VS Code files default to the language you want

On a default VS Code installation, when you create a new file its language mode is 'Plain Text'

You have to click there to set another mode.

Luckily, there's a setting you can tweak to change this. It is called files.defaultLanguage

Set it to the ID of the language you want. Those IDs display in parentheses after each entry on the language mode selector.

Even better, you can set it to use the same language as the file you're currently focused on:

"files.defaultLanguage": "${activeEditorLanguage}"

Comments

Nigel Salm · Jan 29, 2021

Hi John

That's a neat solution. Thanks

Nigel

0