sublime text3下BracketHighlighter的配置方法

来源:互联网 发布:高考作文书推荐 知乎 编辑:程序博客网 时间:2024/05/20 10:51

st3的配置方法和st2是有区别的,所以网上搜索到的方法大多不能用,我google之后总结了一下。

一、

1、在st3中按preferences-->package settings-->Bracket highlighter-->Bracket settings-Default打开配置文件。

2、将左侧配置文件信息全选复制一份到右侧的Bracket settings-User。

3、在配置文件631行开始的"bracket_styles"中,将style改为hightlight(style有四种方式: solid、underline、outline、highlight,根据自己的习惯挑选一种)。

{    "bracket_styles": {        "default": {            "icon": "dot",            // "color": "entity.name.class",            "color": "brackethighlighter.default",            "style": "highlight"        },        "unmatched": {            "icon": "question",            "color": "brackethighlighter.unmatched",            "style": "highlight"        },        "curly": {            "icon": "curly_bracket",            "color": "brackethighlighter.curly",            "style": "highlight"        },        "round": {            "icon": "round_bracket",            "color": "brackethighlighter.round",            "style": "underline"        },        "square": {            "icon": "square_bracket",            "color": "brackethighlighter.square",            "style": "underline"        },        "angle": {            "icon": "angle_bracket",            "color": "brackethighlighter.angle",            "style": "underline"        },        "tag": {            "icon": "tag",            "color": "brackethighlighter.tag",            "style": "highlight"        },        "single_quote": {            "icon": "single_quote",            "color": "brackethighlighter.quote",            "style": "underline"        },        "double_quote": {            "icon": "double_quote",            "color": "brackethighlighter.quote",            "style": "underline"        },        "regex": {            "icon": "regex",            "color": "brackethighlighter.quote",            "style": "outline"        }    }}


 

其中的color默认是brackethighlighter.default,显示为全白,若是改为entity.name.class,在Monokai主题下部分高亮为绿色。

4、将"bracket_styles"以下的样式类型全部去掉注释。

其中对应关系为:

1
2
3
4
5
{} - curly
() - round
[] - square
<> - angle
“” ” - quote

 5、在sublime的安装目录下的Packages文件夹下,找到Color Scheme - Default.sublime-package这个文件,复制一份重命名为Color Scheme – Default.sublime-package.zip,解压找到Monokai.tmTheme

千万不要解压出来然后压缩回去,不然sublime不认识,直接在压缩文件中改,将配色代码添加到Monokai.tmTheme中。再把降修改完成的文件放回解压文件夹重新压缩为Color Scheme – Default.sublime-package.zip,在改名字Color Scheme – Default.sublime-package放回原来的位置就好了。

配色代码可以参考

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<dict>
    <key>name</key>
    <string>Bracket Default</string>
    <key>scope</key>
    <string>brackethighlighter.default</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FFFFFF</string>
        <key>background</key>
        <string>#A6E22E</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Unmatched</string>
    <key>scope</key>
    <string>brackethighlighter.unmatched</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FFFFFF</string>
        <key>background</key>
        <string>#FF0000</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Curly</string>
    <key>scope</key>
    <string>brackethighlighter.curly</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FF00FF</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Round</string>
    <key>scope</key>
    <string>brackethighlighter.round</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#E7FF04</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Square</string>
    <key>scope</key>
    <string>brackethighlighter.square</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FE4800</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Angle</string>
    <key>scope</key>
    <string>brackethighlighter.angle</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#02F78E</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Tag</string>
    <key>scope</key>
    <string>brackethighlighter.tag</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FFFFFF</string>
        <key>background</key>
        <string>#0080FF</string>
    </dict>
</dict>
 
<dict>
    <key>name</key>
    <string>Bracket Quote</string>
    <key>scope</key>
    <string>brackethighlighter.quote</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#56FF00</string>
    </dict>
</dict>

 效果如下图:

阅读全文
0 0
原创粉丝点击