12

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

Drew
  • 75,699
  • 9
  • 109
  • 225
DJ lee
  • 131
  • 1
  • 4

2 Answers2

5

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 Aug 14 '17 at 21:12
-1

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

zck
  • 8,984
  • 2
  • 31
  • 65
user12253
  • 1
  • 1
  • 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. – Andrew Swann Jun 02 '16 at 16:20