Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

<keyword>classname</keyword>

To the section that begins

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

Your Answer

 
discard

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.