Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing the rendering of matching brackets #19534

Open
jeud opened this issue Jan 27, 2017 · 37 comments
Open

Customizing the rendering of matching brackets #19534

jeud opened this issue Jan 27, 2017 · 37 comments
Labels
editor-bracket-matching Editor brace matching editor-theming Issues related to the way themes are applied to editors feature-request Request for new features or functionality
Milestone

Comments

@jeud
Copy link

jeud commented Jan 27, 2017

  • VSCode Version: 1.8.1
  • OS Version: Windows 10

Hi there

Is it possible to customize the cursor for the matching brackets/parentheses ? e.g. change to underline instead of block

it looks unclear sometime

Thanks all

@mousetraps
Copy link
Contributor

mousetraps commented Jan 28, 2017

@jeud thanks for reaching out! Not customizable at the moment, but we're open to ideas. You mentioned "underline" - any other ideas to increase visibility?

@mousetraps mousetraps added editor editor-bracket-matching Editor brace matching feature-request Request for new features or functionality labels Jan 28, 2017
@fatalitynt
Copy link

fatalitynt commented Feb 6, 2017

Hello!
Make more user-settings about brackets and cursor, for example:

editor.bracketMatchingStyle: rectangle|block|underline
editor.bracketMatchingColor: #rgb
editor.cursorColor: #rgb

I found some .css about brackets in source, and I hope it is not difficult make brackets more customizable.

@tadlambjr
Copy link

Making the brackets bold would be good too.

@csalv5
Copy link

csalv5 commented Mar 12, 2017

Also #3788, take it into account please, underline is far less cluttered.

@cesaraaron
Copy link

#22504 as well.

For the color looks like Sublime uses some key of the current .thTheme (see 22504).
It'd be great as 'editor.bracketMatchingColor' like @fatalitynt suggested but that would add an unnecessary option to the settings imo.

@jungchris
Copy link

This issue appears to duplicate Better bracket highlight visibility #12402

@rnithish
Copy link

rnithish commented Aug 8, 2017

Highlighting with a mild color based on the current user theme, seems to be most appealing to me.

@jafrajarvy292
Copy link

  1. Agreed the boxes should be removed and replace with perhaps background coloring. The problem is the vertical box lines look too much like the cursor itself, making it difficult to find your cursor in cases where it's overlapping a box line. Yes, I know the cursor is bold and you can still find it, but I find it blends in more than it should.

  2. Allow customization on the matching bracket/parenthesis pairs. The boxes aren't enough to identify the matching pairs, as others have mentioned.

You can reference how Notepad++ does it. I think they handle it very well.

@DarthPestilane
Copy link

DarthPestilane commented Sep 19, 2017

Perhaps we can use Subtle Match Brackets which changes the block into underline
Like this:
image
https://marketplace.visualstudio.com/items?itemName=rafamel.subtle-brackets
thanks for Rafa Mel

@notrealdev
Copy link

How to change Bracket color or underline? not background and border!

@mrchief
Copy link

mrchief commented Dec 13, 2017

Subtle Match Brackets works but is slow to load/initialize.

@dmstern
Copy link

dmstern commented Mar 30, 2018

As @DarthPestilane said, SubtleBrackets by @rafamel does a really good job here. 👍

Examples:
vscode-subtle-brackets-settings-1
vscode-subtle-brackets-settings-2
vscode-subtle-brackets-settings-3

Styling documentation: https://code.visualstudio.com/docs/extensionAPI/vscode-api#DecorationRenderOptions

@jcklpe
Copy link

jcklpe commented May 28, 2018

@dmstern Is there someplace in documentation that I can get a full list of the different styling properties available to Brackets Colorizer? I tried some of the subtle brackets ones you show above and they work! But I don't know how many other CSS properties work also. It's hard to tell because the JSON format for the CSS properties are done in a style that's different than the naming convention of CSS itself so I assume there's some additional level in JS that's translating it etc over to CSS styling for the plugin etc.

@mrchief
Copy link

mrchief commented May 28, 2018

Bracket Pair Colorizer works pretty well.

@jabacchetta
Copy link

jabacchetta commented Feb 8, 2019

The subtle brackets extension is pretty much what I believe a lot of us are looking for, but it has issues (HTML/JSX brackets not highlighting, for example). Would love to see this feature (underline) supported natively.

@jaredh159
Copy link

If you're comfortable just tweaking the colors, you can do so in your settings.json, like so:

bracket-colors

More useful stuff like this at https://vscode.readthedocs.io/en/latest/getstarted/theme-color-reference

@phuze
Copy link

phuze commented Apr 25, 2019

I'll add that Highlight Matching Tag is a top notch extension. I use it, along with a setting to remove the occurances highlighting: "editor.occurrencesHighlight": false

Result:

image

image

@kanlukasz
Copy link

It could be merge with this -> #46804

@alexdima alexdima changed the title Customizing the cursor for the matching brackets/parentheses Customizing the rendering of matching brackets/parentheses Oct 16, 2019
@alexdima alexdima changed the title Customizing the rendering of matching brackets/parentheses Customizing the rendering of matching brackets Oct 16, 2019
@alexdima alexdima added the editor-theming Issues related to the way themes are applied to editors label Oct 24, 2019
@karan221
Copy link

karan221 commented Feb 1, 2020

@jeud thanks for reaching out! Not customizable at the moment, but we're open to ideas. You mentioned "underline" - any other ideas to increase visibility?

Changing the brace color to a brighter color on matching would be nice.

@injust90
Copy link

@jeud thanks for reaching out! Not customizable at the moment, but we're open to ideas. You mentioned "underline" - any other ideas to increase visibility?

In IntelliJ I was able to bold, italicize, or underline matching brackets. Was able to modify my matching brackets in a way that was most visible to me.

@nahuel
Copy link

nahuel commented May 13, 2020

Another idea, colorize all the enclosed expression instead of only the matching bracket, like Emacs does here:

Untitled

Emacs config:

(setq show-paren-delay 0)
(setq show-paren-style 'expression)
(show-paren-mode 1) 
(set-face-attribute 'show-paren-match 
                     nil 
                     :inherit 'unspecified
		     :background "darkgreen"
		     :foreground 'unspecified 
                     :weight 'unspecified )

@leecade
Copy link

leecade commented May 17, 2020

I'd prefer underline

@dmstern
Copy link

dmstern commented May 19, 2020

For those who are looking for more cool examples:

I made the matching brackets style also match the new Ubuntu 20.04 switch button outline style:

vscode-ubuntu-settings-brackets-Screenshot-2020-05-20---12-11-27-crop

settings.json:

"subtleBrackets.style": {
    // https://vshaxe.github.io/vscode-extern/vscode/DecorationRenderOptions.html
    // rounded border:
    "borderWidth": "2px",
    "borderStyle": "solid",
    "borderColor": "#b97056",// "#99999977",
    "borderRadius": "8px",
    "fontWeight": "bold",
    "backgroundColor": "#99999922",
    "letterSpacing": "3px",
  },

Or monochrome:
image

@LMCyber
Copy link

LMCyber commented Jul 29, 2021

I deactivate the box here...
4eed166bf9c2f71c754240a94e694868

@setanarut
Copy link

there is no properly working extension available, no one has been dealing with this issue for years, unbelievable.
rafamel/subtle-brackets#31 (comment)

@jonjieviduya
Copy link

Any update with this?

@karan221
Copy link

karan221 commented Oct 1, 2021

Check this https://youtube.com/shorts/elNuPq3GFXg?feature=share .

@jonjieviduya
Copy link

@karan221 underline is different from changing colors.

@karan221
Copy link

karan221 commented Oct 3, 2021

@karan221 underline is different from changing colors.

Just sharing, I got what I had requested in a comment above.

@effinsky
Copy link

effinsky commented Oct 4, 2021

Is there any way that I could change the color of the highlighted brackets/braces etc? Something like here? Just the ones I'm currently in the scope of, I mean :)

Screenshot 2021-10-04 at 11 52 53

I cannot seem to find the right option in the settings, and I thought I would among:

Screenshot 2021-10-04 at 11 57 05

Thanks a bunch!!

@jusmarks
Copy link

The main problem is the cursor can be hard to spot if it overlaps with the bracket's border. If this problem were solved then I think custom rendering of matching brackets might not be necessary.

Maybe in this case the border could be made transparent (or some other color)? This could be achieved with a property similar to editorCursor.background:

editorCursor.background: The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.

With something like:

editorCursor.borderBackground: The border background color of the editor cursor. Allows customizing the color of a border overlapped by a cursor.

matchborder

@PyaeSoneAungRgn
Copy link

any update?

@tzargar8
Copy link

tzargar8 commented Mar 19, 2024

So this still hasn't been fixed? Should be a 5 minute job.

Microsoft...

@aminahbl
Copy link

Echo, echo, echo...

@setanarut
Copy link

Bill Gates are you there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-bracket-matching Editor brace matching editor-theming Issues related to the way themes are applied to editors feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests