Pinaki Sekhar Gupta
Pinaki Sekhar Gupta

Reputation: 55

MatchParen and cursorcolumn conflict

Vim is not showing the matching brackets on the same column when I do in _vimrc

:set cursorline
:set cursorcolumn

Actually I have in my _vimrc

:set cursorline
:set cursorcolumn

:highlight CursorLine  term=underline  guibg=#fffcd0  cterm=underline
:highlight CursorColumn  term=underline  guibg=#e1ffd5  cterm=underline

Then the matching bracket on the same column does not highlight.

I tried below playing with guibg and guifg with Black and Cyan and gui=inverse as:

:highlight MatchParen  guibg=somecolors  guifg=othercolor  gui=inverse

But nothing works.

I need the highlighted current column as #e1ffd5 and current line as #fffcd0, and the matching brackets highlighted.

I need the both. How can I?

Normally if you do not turn on cursorline and cursorcolumn then there will be no problem, vim will show every matching paren normally, like: image01.

All the problems will take place if you turn on cursorline and cursorcolumn. The matching paren highlight on the same column at the other end will be vanished, like: image02.

Finally I tried

:highlight MatchParen    guibg=Black guifg=Cyan gui=inverse

But this also is not very perfect. Paren on the other side will fade into white, which I never want.

I want everything perfectly, better saying a mixture of picture 1 and 2 both. I tried but I could not.

Upvotes: 2

Views: 1511

Answers (2)

user3407582
user3407582

Reputation: 11

With the cterm settings I found the following.

First I found that the following command made the matching paren disappear.

:hi MatchParen    cterm=NONE ctermfg=black ctermbg=white

While my cursor was on these pren, I switched over to next vertical split, and saw that the colors of the matching peren were reversed.

That led me to the solution with the following command.

:hi MatchParen    cterm=reverse

or

:hi MatchParen    cterm=reverse ctermfg=<your color> ctermbg=<your color>

I think the color you are looking for is

(steelblue and black) or (black and steelblue) 

My setting and I didn't change :hi cursorcolumn.

:hi MatchParen    cterm=reverse ctermfg=NONE ctermbg=NONE

Upvotes: 1

romainl
romainl

Reputation: 196886

enter image description here

Setting ctermfg and/or guifg to NONE gets you what you want.

hi CursorColumn cterm=NONE ctermbg=236 ctermfg=NONE gui=NONE guibg=#2d2d2d guifg=NONE
hi CursorLine   cterm=NONE ctermbg=236 ctermfg=NONE gui=NONE guibg=#2d2d2d guifg=NONE

Upvotes: 2

Related Questions