Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code save language mode (override default)

I have some ASP files in a folder. I would like to view some of them using the default ASP language mode, others I prefer to view in HTML.

If I switch a file to use HTML, it doesn't remember that setting next time I open VS Code.

Is it possible to save this setting per file?

Thanks in advance.

like image 398
Case Avatar asked Mar 16 '18 10:03

Case


People also ask

How do I change the default formatter in VS Code?

Now, highlight your code and right-click. Select Format Document. Once you click on Format Document, a dialog box will tell you to configure your code formatter. This is to set your default code formatter.

How do I disable VS Code restricted mode?

To disable the Restricted mode status bar entry: Right click in the status bar. Uncheck the workspace trust entry.


1 Answers

What you are looking for is the "files.associations" setting. You can specify this setting for each file or also for complete directories:

"files.associations": {
    "**/somefolder/*.asp": "html", // add complete folder
    "**/myfileName.asp": "html" // add a specific file 
}
like image 91
HaaLeo Avatar answered Nov 15 '22 08:11

HaaLeo