Customizing/disabling VIM’s matching parenthesis highlighting

I find vim’s matching parenthesis highlighting feature useful, but the default colors drive me nuts!

It highlights the matching brace/bracket so vividly, I keep on getting confused with the cursor position!

Here are a few solutions to this annoyance.

Change the matching parenthesis font color and/or text-style

To customize the font color, background color and/or text-style of the matching brace/bracket highlighting feature in vim, place the following in the .vimrc file in your home directory (replace STYLE, FGCOL and BGCOL with your preference).

:hi MatchParen cterm=STYLE ctermbg=BGCOL ctermfg=FGCOL

STYLE can be ‘none’, ‘underline’ or ‘bold’.

FGCOL and BGCOL can be ‘none’, or the name of the desired color.

Example 1: Display matching parenthesis in bold text

:hi MatchParen cterm=bold ctermbg=none ctermfg=none

Example 2: Display matching parenthesis in underlined text

:hi MatchParen cterm=underline ctermbg=none ctermfg=none

Example 3: Display matching parenthesis with custom font color

:hi MatchParen cterm=none ctermbg=none ctermfg=white

And you can figure the rest out.

Turn off matching parenthesis highlighting

To completely disable the matching brace/bracket highlighting feature in vim, place the following in the .vimrc file in your home directory.

let g:loaded_matchparen=1

Tags: , , , , ,

  1. Anil Raj

    Thanks for sharing this.
    I too faced this trouble for long.

  2. Sashi Malladi

    Thanks!
    The default setting in Vim is quite an annoyance and I set it up according to #3 above and it immediately put a smile on my face.
    Cheers,
    Sashi

  3. Oflixs

    Yeah! thanks a lot, the default setting was a nightmare …oooOOooo…

Add a Comment