Sublime colorize :javascript block in haml

烂漫一生 提交于 2019-12-05 12:18:37

问题


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 that: "Text inside Ruby, ERB, Javascript, Sass, and CSS filters are now properly recognized so you get all the syntax highlighting, snippets, commands, etc." but in sublime it doesn't work.


回答1:


For me, sublime 3, comes installed with Rails package. This also provide "Ruby Haml". If you press ctrl + alt + p and type haml you will probably see two Set Syntax: Ruby Haml.

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

// Put your custom syntax rules here:
"syntaxes": [
    {
        "name": "Haml/Syntaxes/Ruby Haml",
        "extensions": ["haml"],
        "rules": [
            {"file_name": ".*\\.haml$"}
        ]
    }
]



回答2:


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...



来源:https://stackoverflow.com/questions/18856668/sublime-colorize-javascript-block-in-haml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!