美文网首页
Sublime Text BracketHighlighter配

Sublime Text BracketHighlighter配

作者: Nevrast | 来源:发表于2019-05-02 17:30 被阅读0次

    官方文档 http://facelessuser.github.io/BracketHighlighter/customize/

    官方文档不知道为什么这么多,如果只需要高亮下括号,只需下面两步。

    1. 首先, Package Settings->BracketHighligher->Bracket Settings添加如下配置("style"可以按照自己口味设置,有underline, outline, solid, highlight这些模式)
    {
        // Define region highlight styles
        "bracket_styles": {
            // "default" and "unmatched" styles are special
            // styles. If they are not defined here,
            // they will be generated internally with
            // internal defaults.
    
            // "default" style defines attributes that
            // will be used for any style that does not
            // explicitly define that attribute.  So if
            // a style does not define a color, it will
            // use the color from the "default" style.
            "default": {
                "icon": "dot",
                // BH1's original default color for reference
                // "color": "entity.name.class",
                "color": "brackethighlighter.default",
                "style": "underline"
            },
    
            // This particular style is used to highlight
            // unmatched bracket pairs.  It is a special
            // style.
            "unmatched": {
                "icon": "question",
                "color": "brackethighlighter.unmatched",
                "style": "outline"
            },
            // User defined region styles
            "curly": {
                "icon": "curly_bracket",
                "color": "brackethighlighter.curly",
                "style": "highlight"
            },
            "round": {
                "icon": "round_bracket",
                "color": "brackethighlighter.round",
                "style": "highlight"
            },
            "square": {
                "icon": "square_bracket",
                "color": "brackethighlighter.square",
                "style": "highlight"
            },
            "angle": {
                "icon": "angle_bracket",
                "color": "brackethighlighter.angle",
                "style": "highlight"
            },
            "tag": {
                "icon": "tag",
                "color": "brackethighlighter.tag",
                "style": "highlight"
            },
            "c_define": {
                "icon": "hash",
                "color": "brackethighlighter.c_define",
                "style": "highlight"
            },
            "single_quote": {
                "icon": "single_quote",
                "color": "brackethighlighter.quote",
                "style": "highlight"
            },
            "double_quote": {
                "icon": "double_quote",
                "color": "brackethighlighter.quote",
                "style": "highlight"
            },
            "regex": {
                "icon": "regex",
                "color": "brackethighlighter.quote",
                "style": "underline"
            }
        }
    }
    
    1. 修改正在使用的主题
      例如我电脑上是Monokai Pro (Filter Spectrum),则新建一个文件Monokai Pro (Filter Spectrum).sublime-color-scheme放在{Sublime配置目录}\Packages\User下,文件内容如下(颜色可以自定义):
    {
        "rules": [
            {
                "scope": "brackethighlighter.default",
                "foreground": "#CC99CC"
            },
            {
                "scope": "brackethighlighter.unmatched",
                "foreground": "#F2777A"
            },
            {
                "scope": "brackethighlighter.curly",
                "foreground": "#CC99CC"
            },
            {
                "scope": "brackethighlighter.round",
                "foreground": "#FFCC66"
            },
            {
                "scope": "brackethighlighter.square",
                "foreground": "#6699CC"
            },
            {
                "scope": "brackethighlighter.angle",
                "foreground": "#F99157"
            },
            {
                "scope": "brackethighlighter.tag",
                "foreground": "#66CCCC"
            },
            {
                "scope": "brackethighlighter.c_define",
                "foreground": "#F99157"
            },
            {
                "scope": "brackethighlighter.quote",
                "foreground": "#99CC99"
            }
        ]
    }
    

    然后就完成了,效果大概是这样:


    相关文章

      网友评论

          本文标题:Sublime Text BracketHighlighter配

          本文链接:https://www.haomeiwen.com/subject/uawnnqtx.html