Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 have a problem with Gedit and it's way of highlighting new Ruby syntax. In Ruby 1.9.x, we can write Hash this way:

{ class: 'class_name', id: 'uniq_id' }

instead of

{ :class => 'class_name', :id => 'uniq_id' }

In new syntax, Gedit highlights class: as keyword instead of symbol.

Is there any solution to make Gedit highlight Ruby syntax the correct way?

share|improve this question

Your boggle actually lies with GtkSourceView and the file /usr/share/gtksourceview-3.0/language-specs/ruby.lang. At least I think it's that version. You might want /usr/share/gtksourceview-2.0/language-specs/ruby.lang if changing 3.0 does nothing.

Anyway, you'll need to hack around in there to fix the syntax. And I suggest you push the change up to the gtksourceview maintainers so other people can benefit.

Or look at the following:

They seem to have updated the specs and they provide instructions for installing it in a 2.0 environment (should be simple enough to adapt).

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.