将后缀添加到Atom编辑器以正确显示代码

时间:2018-11-27 11:11:40

标签: atom-editor

我正在使用Contao CMS,模板文件的后缀为.html5。 现在,当我打开该文件时,我希望代码像PHP代码一样显示。

Thx

1 个答案:

答案 0 :(得分:0)

您可以在Atom配置中定义custom file typeconfig.cson,可以从Atom菜单中打开)。

enter image description here

截屏:macOS上的Atom菜单

示例:

core:
  customFileTypes:
    "source.php": [
      "html5"
    ]

请记住,这是一个CoffeeScript对象符号文件,因此正确的缩进很重要。如果现有core键,请向其中添加customFileType

这是另一个具有更多上下文的示例:

"*":
  core:
    telemetryConsent: "limited"
    themes: [
      "one-light-ui"
      "one-dark-syntax"
    ]
    customFileTypes:
      "source.php": [
        "html5"
      ]

如果您喜欢JSON,可以将同一文件转换为JSON,并相应地命名为config.json

相关问题