Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change VSCode Default Language for new files?

Is there a way in Visual Studio Code to change the default language that is used for new files?

By default if you open a new file, it's set for "Plain Text", I want this to be "HTML" instead.

I am often copy pasting HTML into VSC, editing a bit, then copying it back to a CMS I am using (the CMS editor is horrible). I don't want to save the code on my computer at all, just edit it a bit with HTML syntax highlighting, but I want that to be the default.

like image 907
BlueCaret Avatar asked Mar 09 '16 22:03

BlueCaret


People also ask

How do I change the default interpreter path in VSCode?

To do so, open the Command Palette (Ctrl+Shift+P) and enter Preferences: Open User Settings. Then set python.condaPath , which is in the Python extension section of User Settings, with the appropriate path.


1 Answers

You can now set the default language at either the user or workspace settings level using files.defaultLanguage:

"files.defaultLanguage": "html" 

This can be done as a one off by changing the language mode:

  1. F1 to launch command palette
  2. Type lang, enter
  3. Type html, enter
like image 80
Daniel Imms Avatar answered Oct 13 '22 04:10

Daniel Imms