Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set default file type to be All Files(*.*) in VS Code?

Now my default file type of Visual Studio Code is Plain Text.

If I save a new file with name like a.in, it will save as a.in.txt. I have to change the dropdown to All Files.

I find the same problems in github: 1, 2. However, they seem not solve my problem.

like image 724
namasikanam Avatar asked Nov 08 '22 03:11

namasikanam


1 Answers

There is a way to change the default extension (but not to All Files)

Add the following line to your settings.json

"files.defaultLanguage": "<language>",

Replace <language> with the language of your choice. Now, whenever you make a new a file, the default file language will be <language>.

A special value for <language> is ${activeEditorLanguage} which is the language of the file last opened (useful if, say, you copy a piece of code from one file to save as another).

Unfortunately, this does not fully answer the question, but provides a partial solution.

like image 126
sushant_padha Avatar answered Nov 17 '22 04:11

sushant_padha