Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

visual studio code - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...