1

I used the MatchParen to match the parenthesis while coding C++ projects.

Here is my config in .vimrc:

hi MatchParen cterm=underline ctermbg=NONE ctermfg=DarkCyan
set matchpairs+=<:>

However, it doesn't work very well when cout and cin appear together. Here is an example: enter image description here

As you see, the two angle brackets are matched, which is not what we expected.

Is there some way or some vim-plugin to avoid this?

  • 1
    There are other similar cases, as <, >, <<, >>, <=, >= are valid operators in c++, my suggestion is to let it go, as long as it doesn't bother you when you deal with template parameters. – dedowsdi Aug 19 at 3:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.