Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm C++ programming in ubuntu 12.04 using gedit and it recognizes c++ default commands. I was wondering if I can make it able to recognize the new classes I define and change their color in the code or sth.

thank you

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I don't believe there is an automatic way to do this, but you can do it manually. If you run gksudo gedit /usr/share/gtksourceview-3.0/language-specs/cpp.lang, it will open the definition file that controls how gedit does syntax highlighting for C++. If you want your classes to have the same color as the built-in types (e.g. bool), add a line like


To the section that begins

<context id="types" style-ref="type">
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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