Sublime Text 3中的不同高亮JS和CSS

萨莎·切尔尼赫(Sasha Chernykh)

我知道如何更改javascript和CSS突出显示的颜色。我将以下字符串添加到我的活动tm.Theme文件中<array></array>

    <dict>

    <key>name</key>

    <string>Embedded source</string>

    <key>scope</key>

    <string>text source, string.unquoted</string>

    <key>settings</key>

    <dict>

    <key>background</key>

    <string>#804A7D99</string>

    </dict>

    </dict>

结果:

紫罗兰色背景

但是,如何使JS和CSS的背景变得多样化,以便在minimap上进行引导更方便?例如:

JS-蓝色

蓝色背景

CSS —绿色

绿色背景

谢谢。

Enteleform

在此处输入图片说明

包括在你的下面的代码tmTheme文件来处理混合JSCSS,和HTML

    <dict>
        <key>name</key>
        <string>JS_Source</string>
        <key>scope</key>
        <string>source.js.embedded.html</string>
        <key>settings</key>
        <dict>
            <key>background</key>
            <string>#2D6A73</string>
            <key>foreground</key>
            <string>#7B91B9</string>
        </dict>
    </dict>

    <dict>
        <key>name</key>
        <string>CSS_Source</string>
        <key>scope</key>
        <string>source.css.embedded.html, meta.attribute-with-value.style.html source.css</string>
        <key>settings</key>
        <dict>
            <key>background</key>
            <string>#2D7333</string>
            <key>foreground</key>
            <string>#7B91B9</string>
        </dict>
    </dict>

    <dict>
        <key>name</key>
        <string>HTML_Text</string>
        <key>scope</key>
        <string>text.html</string>
        <key>settings</key>
        <dict>
            <key>background</key>
            <string>#783727</string>
            <key>foreground</key>
            <string>#7B91B9</string>
        </dict>
    </dict>

正如@KeithHall在评论中提到的,作用域的使用:

CSS:   source.css.embedded.html, meta.attribute-with-value.style.html source.css
JS:    source.js.embedded.html

将允许您将这些自定义背景色应用于HTML语法,而不会影响CSSJS语法。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章