I am trying to highlight my own class name and function name in C++ via GVim. I read and followed the link from stackoverflow. Please also check out the result link
I copied the following settting in my cpp.vim where is under syntax directory.
" Highlight Class and Function names
syn match cCustomParen "(" contains=cParen,cCppParen
syn match cCustomFunc "\w\+\s*(" contains=cCustomParen
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi def link cCustomFunc Function
hi def link cCustomClass Function
It worked, but highlight my brackets in red. How do I disable the highlight of the brackets? I deleted .vimrc file and open my cpp file again, it's still same. So I think it's the above code issue.
-------------------- Resolved [Solution] --------------------
syn match customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi def customFunc gui=NONE guifg=#E54023
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi def link cCustomClass Function
--------------------------- EOF ------------------------------