How to differentiate color scheme

时间:2016-10-19 13:39:23

标签: colors sublimetext2

I would like to change color scheme Eiffel so that the keyword class in java files will be different color than keyword int? If I change Storage in Eiffel, both keywords change the color.

2 个答案:

答案 0 :(得分:0)

您需要找出classint的确切范围。 PackageResourceViewer是在.sublime-package文件中打开文件的好方法。

安装完成后,启动*“PackageResourceViewer:Open Resource , open the Java package and look for the syntax files (e.g. Java.sublime-syntax`。”

我对Java不够熟悉,但我认为class使用范围meta.classint使用storage.type.primitive.array。这意味着,在您的主题中,您至少需要更改metastorage。不用说,你可以比这更具体。

答案 1 :(得分:0)

使用名为ScopeAlways的漂亮小插件,您可以在状态栏中看到光标所在的完整范围(如果您有多个光标,它只使用第一个光标)。在Sublime Text 2中,使用以下代码:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello World!");
        int integer = 13;
    }
}

单词class的范围为storage.modifier.java,而int的范围为storage.type.primitive.array.java(为清晰起见,我从每个范围中删除了一些不重要的无关范围)。因此,在您的主题中,您可以为storage.modifier添加一种颜色,为storage.type添加另一种颜色,以区分classint。但请注意,许多其他关键字都属于这两个范围,因此您的自定义颜色不会突出显示这些特定字词。

祝你好运!