Set vim bracket highlighting colors

you can change the colors to, e.g., blue over green

hi MatchParen cterm=none ctermbg=green ctermfg=blue

just put it in your vimrc file.

basically, cterm determines the style, which can be none, underline or bold, while ctermbg and ctermfg are, as their names suggest, background and foreground colors, so change them as you see fit.

for your case, you may want

hi MatchParen cterm=bold ctermbg=none ctermfg=magenta

I'm using the vividchalk color scheme with macvim, and none of the various solutions I tried worked for me. But I searched the file:

~/.vim/colors/vividchalk.vim

for MatchParen and I found this line:

call s:hibg("MatchParen","#1100AA","DarkBlue",18)

I commented out that line, then I copied that line, and I changed it to:

 call s:hibg("MatchParen","#FF0000","Red",18)

which succeeded in highlighting the matching parenthesis in red, which is a LOT easier to see. I hope that helps someone else.

If you want to briefly jump to the opening bracket/paren/brace when you type the closing bracket/paren/brace, then adding:

set showmatch

to ~/.vimrc worked for me.

A very handy trick is setting the cursor on a bracket/paren/brace and then typing % to jump to the matching bracket/paren/brace. That is especially useful when the matching bracket/paren/brace has scrolled off the page. Typing % a second time will jump back to where you came from.

Tags:

Vim