SubLime BracketHighlighter 配置

 

很多插件在github上都有比较详细的说明  告知安装位置什么的
一般来说 插件都是放在Packages目录里面的   从Github上下载 解压得到的文件夹然后放入到Packages中
这个目录在哪里呢?  Preferences----browse packages 即可看到


这里我只说说BracketHighlighter  就是高亮括号用啦
网络好的话可以在install packages 里面搜索

 

手动安装

尽管http://www.ladyloveit.com/sublime/developers-commonly-used-10-sublime-text-plugin/
这里说下载后就可以直接用  但是还是要配置下的
去Github获取https://github.com/facelessuser/BracketHighlighter‎
解压后是BracketHighlighter-master 文件夹 改为BracketHighlighter放入到packages中
(不去掉后面的master的话接下来的文件因为路径不对是找不到的...显示的时木有内容)

配置参考http://www.cnblogs.com/liu-liang/archive/2013/06/09/3129471.html
在preferences-->package settings-->Bracket highlighter-->Bracket settings-Default会打开一个文件
将"bracket_styles"中的style改为hightlight
"bracket_styles"以下的样式类型去掉注释  ----注意语法!(不要忘了添加逗号)

原来这里写的样式可能是underline Or outline ... 表示的是用underline和outline的方式来强调括号

改为highligter 则是用颜色来强调  所以把default里面改为 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": "highlight"
        },

        // This particular style is used to highlight
        // unmatched bracekt 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": "underline"
        },
        "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",
            // "endpoints": true,
            // "color": "brackethighlighter.tag",
            "style": "outline"
        },
        "c_define": {
            "icon": "hash"
            // "color": "brackethighlighter.c_define",
            // "style": "underline"
        },
        "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": "underline"
        }
    },

 

 自定义高亮颜色

再来到Packages----Color Scheme - Default 文件夹
找到你所使用的配色(主题)文件(我的是Solarized(Light).tmTheme),打开
这里就是自定义各种括号的配色啦!
配色可以参考http://stackoverflow.com/questions/15661731/sublime-bracket-highlighter-not-coloring-brackets

这是我的配色 (针对默认主题Monokai) 就是在Monokai.thTheme 对应位置写上下面的配置(这里就是配置颜色)

这个配色不是很好... 如果不配色默认的也不错

    <dict>
        <key>name</key>
        <string>Unmatched</string>
        <key>scope</key>
        <string>brackethighlighter.unmatched</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#FFC683</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>#FFAB00</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>#FFAB00</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>#FFAB00</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>#FFAB00</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>#FFAB00</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>#FFAB00</string>
        </dict>
    </dict>

  

 

posted @ 2014-01-02 15:55 cart55free99 阅读(...) 评论(...) 编辑 收藏