sublime3 中 python - class 名称的自定义配色方案

Custom color scheme in sublime3 for python - class names

我为 python 创建了 sublime text 3 的自定义配色方案。不幸的是,我无法获得 class 名称的工作前景。

<dict>
    <key>name</key>
    <string>Class name</string>
    <key>scope</key>
    <string>entity.name.class</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#CD950C</string>
    </dict>
</dict>

我的错误在哪里?

您有一个小错误 - 作用域的名称。它实际上是 entity.name.type.class.python,但您可以根据需要省略 .python

如果您对主题感兴趣,我强烈推荐两个插件。第一个,对于像我这样严肃的核心配色方案设计师来说,是 ScopeAlways. It does just what its name says - displays the current scope at the cursor point (or the first cursor, if you have multiple) in the bottom status bar. You can turn it off if you want, as it can get a bit annoying. The second, less intrusive plugin is ScopeHunter,它由自定义组合键或从命令面板中选择触发。它是非常可配置的,可以在弹出窗口 window 或快速面板中显示当前范围信息,并且具有附加功能,您可以根据需要复制整个范围字符串,而不是尝试将其全部正确键入手动。

祝你好运!