Amir
Amir

Reputation: 4770

Force VS Code to open new files as the same type as current file open

I could have sworn this was added as a feature a while back, but has now been removed with a recent update? Example, if I have my_file.ts open, and I go to new => file, I want it to create Untitled-1.ts as a TS file instead of plain text. I can't find it in the settings and I don't even know what to search for really. I'm sure it's in the settings somewhere.

Upvotes: 2

Views: 163

Answers (1)

Mosh Feu
Mosh Feu

Reputation: 29267

Found it. It's files.defaultLanguage. If you set it as ${activeEditorLanguage} it will do what you've described. I wouldn't aware of this option before :)

screenshot of settings

Reference

Upvotes: 2

Related Questions