I want to change the highlighting of the function names inside a c++ file, here is an example

enter image description here

As you can see in the previous picture functions names have their own color, parser(), parse(), get_headers(), get_http_version().

  • You basically need to figure out the highlight group for c++ functions and override it (i like autocommand with the ColorScheme event). Im away from my laptop and cant help atm, but this should give you enough to self-answer. You can use this answer or my plugin to get the groups
    – D. Ben Knoble
    May 17 '19 at 20:00
  • I really appreciate that, thank you. But found out that there is not highlight group for function names in the default cpp syntax file in vim. There is an enhanced syntax file here that define the functions and classes highlight groups, solves the problem
    – Taha Magdy
    May 17 '19 at 23:37

The default vim cpp syntax lacks highlight group for function and class names, there is an enhanced cpp syntax that defines much more language constructs than the default.

You can change the function colors using this:

hi clear cppSTLfunction
hi cppSTLfunction ctermfg=74

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.