How to change style of matched brackets in Sublime Text 2 / 3?

后端 未结 5 691
执念已碎
执念已碎 2020-12-12 13:24

It\'s just underlining the matched brackets, Is it possible to make it more useful like changing brackets colour or highlighting the line of brackets?

5条回答
  •  天命终不由人
    2020-12-12 14:14

    Bracket color & other visibility preferences can be modified without the use of a plugin.   Below is a method for implementing such changes natively.

    Note: I recently drafted this answer @ the SublimeText Forum.   There is a similar (unaccepted) answer here, but I have included some unmentioned details & visual reference.


    EXAMPLE

    This is my personal configuration:


    SETTINGS

    Below are all of my visibility related settings.

    As you can see in the examples: brackets settings dictate the color of bracket pairs if a caret is placed ON a bracket, whereas bracketContents settings dictate the color of bracket pairs if a caret is placed WITHIN a set of brackets.

    My bracketContentsOptions is set to underline, but you can change it to foreground if you want it to be highlighted during both instances.

     

    @ Preferences.sublime-settings

    "always_show_minimap_viewport" : true,
    "caret_extra_bottom"           : 3,
    "caret_extra_top"              : 3,
    "caret_extra_width"            : 1,
    "caret_style"                  : "phase",
    "draw_minimap_border"          : true,
    "fade_fold_buttons"            : false,
    "fold_buttons"                 : true,
    "highlight_line"               : true,
    "highlight_modified_tabs"      : true,
    "line_numbers"                 : true,
    "match_brackets"               : true,
    "match_brackets_angle"         : true,
    "match_brackets_braces"        : true,
    "match_brackets_content"       : true,
    "match_brackets_square"        : true,
    "match_selection"              : true,
    "match_tags"                   : true,
    "overlay_scroll_bars"          : "enabled",
    

    @ YourColorScheme.tmTheme

        
    
            guide
            #14191F
    
            stackGuide
            #14191F
    
            activeGuide
            #2E4589
    
        
    
            bracketsForeground
            #D80E64
    
            bracketsOptions
            foreground
    
            bracketContentsForeground
            #D80E64
    
            bracketContentsOptions
            underline
    
        
    
            caret
            #D80E64
    
            lineHighlight
            #121522
    
            selection
            #1D416B
    
            selectionForeground
            #bbccff
    
            selectionBorder
            #4D71FF
    
            inactiveSelection
            #1D416B
    
            inactiveSelectionForeground
            #bbccff
    
        
    
            findHighlight
            #0BD0AC
    
            findHighlightForeground
            #000000
    

提交回复
热议问题