onedark.nvim icon indicating copy to clipboard operation
onedark.nvim copied to clipboard

Parenthesis not visible in comments when matching brackets are highlighted

Open ZenithFlux opened this issue 1 year ago • 2 comments

With onedark: Screenshot from 2024-09-20 11-56-50 Without onedark: Screenshot from 2024-09-20 11-58-58

This is happening because the color of the comments is the same as the matching parenthesis highlight color. This makes using brackets a little difficult in the comments.

ZenithFlux avatar Sep 20 '24 06:09 ZenithFlux

Possible solution: Set the 'MatchParen' highlight group's guibg to a lighter shade.

:h hl-MatchParen

ZenithFlux avatar Oct 12 '24 18:10 ZenithFlux

You could change the colors to fix it. This is my config:

require('onedark').setup {
    style = 'dark',
    colors = {
        grey = '#868686', -- Comments
        light_grey = '#a3abbf',
        bg3 = '#1e1e2e'   -- Selection
    }
}
require('onedark').load()

deanqx avatar Oct 26 '24 12:10 deanqx

Fixed! 🎉

Changed MatchParen background from grey to bg3 for better visibility in comments.

Before: MatchParen used grey background (same as comment color), making parentheses invisible in comments.

After: MatchParen now uses bg3 (a lighter shade), making bracket matching clearly visible even in commented code.

This maintains good contrast while being distinct from the comment color.

navarasu avatar Nov 07 '25 19:11 navarasu