GitHub Atom: How to apply a particular syntax highlighting to some files based on name

前端 未结 4 2022
广开言路
广开言路 2021-02-19 04:48

How can I configure GitHub\'s Atom to make it automatically set a particular syntax highlighting to filenames based on name and/or extensions?

Specific

4条回答
  •  梦毁少年i
    2021-02-19 05:15

    Anyone arriving here looking to add support for template files in php e.g. .tpl, the folloing works in atom 1.10.2. I do not have previous versions so I can't say about earlier versions.

    Add this in your config (config.cson) after core:. I added it after audioBeep: false line.

    customFileTypes:
       "text.html.php": [
        "tpl"
       ]
    

    Documentation made me go around in circles. Several articles wrongly mention source.php where as it should be text.html.php

    Just getting started with atom coming from npp++ basically as I have struggled with snippet support there and hope atom can do a good job.

提交回复
热议问题