Sublime colorize :javascript block in haml

前端 未结 2 1909
天涯浪人
天涯浪人 2021-02-12 22:15

I have sublime 2/3 and the colorize inside a :javascript block doesn\'t work fine.

The package is this https://sublime.wbond.net/packages/Haml

Actually they says

相关标签:
2条回答
  • 2021-02-12 22:45

    Sublime 3 comes with preinstalled Rails package. This package also contains "Ruby Haml" syntax, which does not highlight embedded js etc. If you press ctrl + alt + p and type haml you will probably see two Set Syntax: Ruby Haml, one from Rails package, one from Haml. You need the latter to be used.

    The best solution for me was to install ApplySyntax and in it's user settings add the following:

        // Put your custom syntax rules here:
        "syntaxes": [
            {
                "syntax": "Haml/Syntaxes/Ruby Haml",
                "extensions": ["haml"],
                "rules": [
                    {"file_name": ".*\\.haml$"}
                ]
            }
        ]
    
    0 讨论(0)
  • 2021-02-12 22:47

    https://sublime.wbond.net/packages/Haml (https://github.com/phuibonhoa/handcrafted-haml-textmate-bundle) (installed with Package Control) works for me.

    Though it would be nice to use it as the default somehow...

    0 讨论(0)
提交回复
热议问题