I'm new to emacs and programming in general so please bear with me. I'm trying to use emacs as my C/C++ IDE, and I noticed that in CC mode the variables/functions seemed to be highlighted only during declaration. My question is

  1. Is it possible to highlight variables, and functions on an entire cpp file
  2. If possible, what needs to be added to the .emacs file

Thank you


2 Answers 2


color-identifiers-mode does this for variables, if I understand your question correctly. rainbo-identifiers-mode too, I think. Screenshot is from the former one.

enter image description here

  • 1
    Note: at least for my fonts I can barely differ the colors. The solution is to add :weight ,'bold inside the color-identifiers:colorize function.
    – Hi-Angel
    Commented Aug 14, 2017 at 21:12

zjl-hl.el on https://www.emacswiki.org/emacs/JianliZhao exactly matches your need.

The current default color theme is designed to be used with a white background.

zjl-hl screenshot

  • A precise link and a description of exactly what this claims to do would more helpful. Supplementing with a screenshot of this in action would also improve the answer. Commented Jun 2, 2016 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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