visual-studio-code - 将无扩展名文件关联到 Bash

标签 visual-studio-code

我的 Bash 脚本没有任何扩展名,也没有 shebang 行。当我打开该项目的每个文件时,如何避免必须选择语法突出显示?

最佳答案

files.associations 设置允许匹配任意 glob 模式,而不仅仅是文件扩展名。例如,对于名为 start 的 Bash 脚本,您可以在工作区的 settings.json 中包含以下内容:

"files.associations": {
    "start": "shellscript"
}

您还可以在 {} 之间使用逗号分隔的文件名列表:

"files.associations": {
    "{start,stop}": "shellscript"
}

关于visual-studio-code - 将无扩展名文件关联到 Bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47656415/

相关文章:

azure - 在 docker 镜像中安装 AzureADPreview Powershell 模块失败

visual-studio-code - 如何使用 Visual Studio Code 调试 CucumberJS 脚本

visual-studio-code - 请求个人访问 token 时发生错误。无法读取未定义的属性 x-vss-resourceenant

terminal - VS Code 集成终端的颜色主题

visual-studio-code - VS代码: behavior of "editor.fontLigatures" and "editor.fontVariations"?

visual-studio-code - 如何在 Visual Studio Code 的侧边栏中隐藏某些文件?

python - vscode python启动 'current file'作为模块

visual-studio-code - 如何以编程方式安装所有 VSCode 工作区扩展

python - VSCode 无法将 jupyter notebook 导出到 html

java - Maven java.lang.ClassNotFoundException : com. mysql.jdbc.Driver