How do I make a default syntax by filetype in Atom text editor?

前端 未结 7 582
暗喜
暗喜 2021-01-31 02:17

I want my .ejs files to have html syntax, however, it always opens the files as Plain Text.

In sublime you can choose \"Open all with current extension as...\" then ch

7条回答
  •  北海茫月
    2021-01-31 02:26

    This is now in Atom core, you don't need that file-types package any more.

    Where I work, we use .phl for a certain kind of PHP file. To tell Atom about this, edit config.cson like so:

    core:
        customFileTypes:
          "text.html.php": [
            "phl"
          ]
        themes: [
    // snip
    

    You can find this file at ~/.atom/config.cson, or from the Settings window click the "Open Config Folder" button.

    It's easy to get wrong, as evidenced by the many errors people made on the GitHub issue for the feature.

提交回复
热议问题