Sublime text3配置BracketHighlighter插件。

BracketHighlighter插件是用来匹配相对的符号,然后高亮显示,比如{ }、[ ]、" "等符号的对应高亮显示。原生的ST只提供白色的下划线提示,很不清楚。

安装BracketHighlighter可以直接从PackageController启动,选择install Package,输入BracketHighlighter,等待片刻,即可安装成功。

安装完成之后打开配置文件preferences-->package settings-->Bracket highlighter-->Bracket settings-Default,然后打开之后的文件可能是无法修改的!如果无法修改,就将这里全部的配置信息复制,然后粘贴到preferences-->package settings-->Bracket highlighter-->Bracket settings-User里进行修改。


要修改的地方参照这里 


配置文件里的内容就是针对bracket_styles下面的每条信息的color和style进行修改。这个颜色和样式可以全部设置成一致的,但必须要确定这个颜色。这个就需要在主题的配置文件中去做修改。你当前选择的主题preferencescolor-->scheme(主题方案)选择的是哪一个就去安装Sublime Text的位置去找出对应的主题文件,进去修改。修改的方式参照在前面提到的stackoverflow中的那个方法,颜色值可以按照个人喜好随意修改。



然后就能生效了。



特将stackoverflow中的参考配置方法贴在此处:

I have modified my example based upon the comments of AGS - it now includes a couple of highlight options and the rest are outline. Thank you AGS and thank you to the original poster for creating this useful thread.

bh_core.sublime-settings

{
    "bracket_styles": {
        // This particular style is used to highlight
        // unmatched bracket pairs. It is a special
        // style.
        "unmatched": {
            "icon": "question",
            "color": "brackethighlighter.unmatched",
            "style": "highlight"
        },
        // User defined region styles
        "curly": {
            "icon": "curly_bracket",
            "color": "brackethighlighter.curly",
            "style": "highlight"
        },
        "round": {
            "icon": "round_bracket",
            "color": "brackethighlighter.round",
            "style": "outline"
        },
        "square": {
            "icon": "square_bracket",
            "color": "brackethighlighter.square",
            "style": "outline"
        },
        "angle": {
            "icon": "angle_bracket",
            "color": "brackethighlighter.angle",
            "style": "outline"
        },
        "tag": {
            "icon": "tag",
            "color": "brackethighlighter.tag",
            "style": "outline"
        },
        "single_quote": {
            "icon": "single_quote",
            "color": "brackethighlighter.quote",
            "style": "outline"
        },
        "double_quote": {
            "icon": "double_quote",
            "color": "brackethighlighter.quote",
            "style": "outline"
        },
        "regex": {
            "icon": "regex",
            "color": "brackethighlighter.quote",
            "style": "outline"
        }
    }
}

whatever_theme_file_you_use.tmTheme

<!-- BEGIN Bracket Highlighter plugin color modifications -->

<dict>
    <key>name</key>
    <string>Unmatched</string>
    <key>scope</key>
    <string>brackethighlighter.unmatched</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#FD971F</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>#FF0000</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>#0000FF</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>#800080</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>#AE81FF</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>#FD971F</string>
    </dict>
</dict>

<dict>
    <key>name</key>
    <string>Single Quote | Double Quote | Regex</string>
    <key>scope</key>
    <string>brackethighlighter.quote</string>
    <key>settings</key>
    <dict>
        <key>foreground</key>
        <string>#AE81FF</string>
    </dict>
</dict>

<!-- END Bracket Highlighter plugin color modifications -->


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值