英文:
In VSCode, how to force the file type
问题
在VSCode中,我想强制某些文件具有特定的类型,而不考虑它们的扩展名。
我在考虑在顶部添加一条注释,内容可能是:嘿,我是纯文本(示例)。
英文:
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?
答案1
得分: 1
在VSCode设置中,您可以将您想要的文件与特定语言关联起来:
"settings": {
"files.associations": {
"toto.py": "markdown"
}
}
就像在每个文件的顶部添加纯文本一样,这也是一种非自动操作,但它可以使您的文件更清晰。
[编辑] 根据@starball的评论,您可以在类似问题的更详细答案中找到更多信息,例如此处和此处(如果您将复制的文件放在一个地方,第二个链接可能会有用!)。
英文:
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!).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论