去评论
dz插件网

Sublime Text3 BracketHighlighter高亮色彩配置---灰常实用--推荐

逝水年华
2023/04/21 16:45:26
今天玩Sublime ,结果安装了BracketHighlighter插件后,没效果,郁闷,度娘后总结如下:
BracketHighlighter插件能为Sublime Text提供括号,引号这类高亮功能,但安装此插件后,默认没有高亮,只有下划线表示,不是很醒目,需要配置:
1.   在Sublime Text中用package control安装BracketHighlighter;
2.   安装完成后,打开Preferences -> package settings -> Bracket Highlighter -> Bracket Settings – User,然后添加如下代码:
  1. {
  2.   "bracket_styles": {
  3.     "default": {
  4.        "icon": "dot",
  5.        // "color": "entity.name.class",
  6.        "color": "brackethighlighter.default",
  7.        "style": "highlight"        },
  8.     "unmatched": {
  9.        "icon": "question",
  10.        "color": "brackethighlighter.unmatched",
  11.        "style": "highlight"        },
  12.     "curly": {
  13.        "icon": "curly_bracket",
  14.        "color": "brackethighlighter.curly",
  15.        "style": "highlight"        },
  16.     "round": {
  17.        "icon": "round_bracket",
  18.        "color": "brackethighlighter.round",
  19.        "style": "highlight"        },
  20.     "square": {
  21.        "icon": "square_bracket",
  22.        "color": "brackethighlighter.square",
  23.        "style": "highlight"        },
  24.     "angle": {
  25.        "icon": "angle_bracket",
  26.        "color": "brackethighlighter.angle",
  27.        "style": "highlight"        },
  28.      "tag": {
  29.        "icon": "tag",
  30.        "color": "brackethighlighter.tag",
  31.        "style": "highlight"        },
  32.      "single_quote": {
  33.        "icon": "single_quote",
  34.        "color": "brackethighlighter.quote",
  35.        "style": "highlight"        },
  36.      "double_quote": {
  37.         "icon": "double_quote",
  38.         "color": "brackethighlighter.quote",
  39.         "style": "highlight"        },
  40.      "regex": {
  41.         "icon": "regex",
  42.         "color": "brackethighlighter.quote",
  43.         "style": "outline"        }
  44.   }
  45. }
  
3.  找到Sublime text3安装目录下的Packages中的Color Scheme – Default.sublime-package
  默认路径:C:\Program Files\Sublime Text 3\Packages\Color Scheme – Default.sublime-package
  添加后缀名Color Scheme – Default.sublime-package.zip,解压找到Monokai.tmTheme(颜色主题),拉出来修改。
  
4.  Monokai.tmTheme中添加如下代码:,和里面的dic标签t并列排即可。
  1. <dict>
  2.     <key>name</key>
  3.     <string>Bracket Default</string>
  4.     <key>scope</key>
  5.     <string>brackethighlighter.default</string>
  6.     <key>settings</key>
  7.     <dict>
  8.         <key>foreground</key>
  9.         <string>#FFFFFF</string>
  10.         <key>background</key>
  11.         <string>#A6E22E</string>
  12.     </dict></dict><dict>
  13.     <key>name</key>
  14.     <string>Bracket Unmatched</string>
  15.     <key>scope</key>
  16.     <string>brackethighlighter.unmatched</string>
  17.     <key>settings</key>
  18.     <dict>
  19.         <key>foreground</key>
  20.         <string>#FFFFFF</string>
  21.         <key>background</key>
  22.         <string>#FF0000</string>
  23.     </dict></dict><dict>
  24.     <key>name</key>
  25.     <string>Bracket Curly</string>
  26.     <key>scope</key>
  27.     <string>brackethighlighter.curly</string>
  28.     <key>settings</key>
  29.     <dict>
  30.         <key>foreground</key>
  31.         <string>#FF00FF</string>
  32.     </dict></dict><dict>
  33.     <key>name</key>
  34.     <string>Bracket Round</string>
  35.     <key>scope</key>
  36.     <string>brackethighlighter.round</string>
  37.     <key>settings</key>
  38.     <dict>
  39.         <key>foreground</key>
  40.         <string>#E7FF04</string>
  41.     </dict></dict><dict>
  42.     <key>name</key>
  43.     <string>Bracket Square</string>
  44.     <key>scope</key>
  45.     <string>brackethighlighter.square</string>
  46.     <key>settings</key>
  47.     <dict>
  48.         <key>foreground</key>
  49.         <string>#FE4800</string>
  50.     </dict></dict><dict>
  51.     <key>name</key>
  52.     <string>Bracket Angle</string>
  53.     <key>scope</key>
  54.     <string>brackethighlighter.angle</string>
  55.     <key>settings</key>
  56.     <dict>
  57.         <key>foreground</key>
  58.         <string>#02F78E</string>
  59.     </dict></dict><dict>
  60.     <key>name</key>
  61.     <string>Bracket Tag</string>
  62.     <key>scope</key>
  63.     <string>brackethighlighter.tag</string>
  64.     <key>settings</key>
  65.     <dict>
  66.         <key>foreground</key>
  67.         <string>#FFFFFF</string>
  68.         <key>background</key>
  69.         <string>#0080FF</string>
  70.     </dict></dict><dict>
  71.     <key>name</key>
  72.     <string>Bracket Quote</string>
  73.     <key>scope</key>
  74.     <string>brackethighlighter.quote</string>
  75.     <key>settings</key>
  76.     <dict>
  77.         <key>foreground</key>
  78.         <string>#56FF00</string>
  79.     </dict></dict>
  
5.  然后再降修改完成的文件放到压缩包Color Scheme – Default.sublime-package.zip里边,最后改名Color Scheme – Default.sublime-package放回C:\Program   Files\Sublime Text 3\Packages中;
效果图

Tips:千万不要将Color Scheme – Default.sublime-package.zip解压再压缩,否则sublime无法识别这个文件;
原文网址:http://www.cnblogs.com/willingtolove/p/4657320.html