0

In VSCode, I would like to force some files to be of a specific type, regardless of their extensions.

I am thinking about a comment to put on top that would say: Hey, I am a plain text (example).

Any idea?

jehon
  • 1,404
  • 15
  • 21
  • are the kinds of file type associations you want to make able to be based upon the file extensions? Or do the file extensions not have a clear, usable pattern? – starball Jul 20 '23 at 08:28

1 Answers1

1

In VSCode settings, you can associate the files you want with a specific language:

"settings": {
        "files.associations": {
            "toto.py": "markdown"
        }
}

It is just like adding the plain text on top of each file, you have also a non-automatic action, but it leaves your files cleaner.

[EDIT] Following the comment from @starball, you can find more detailed answers on similar questions here and here for example (the second one might be interesting if you put your copied files in a single place!).

matleg
  • 618
  • 4
  • 11
  • if this is your answer, you should probably be flagging as a dup of https://stackoverflow.com/questions/29973619/how-to-associate-a-file-extension-with-a-certain-language-in-vs-code instead of answer-posting. see [answer]. that said, I think this question should provide more details before getting answers. – starball Jul 20 '23 at 08:27
  • This is a possible solution. But when copying files, I would need to reconfigure vscode. any other idea? – jehon Jul 20 '23 at 08:38