tags:

views:

544

answers:

3

Hi, I'm trying to use Ubuntu for Rails development and I'm liking gedit except the syntax highlighting does not seem to work with out me setting it for each file I open. Should it not recognize a .rb file a ruby file rather than me having to go into the menu and setting it as such?

Have I missed a setting somewhere?

Thanks

A: 

Syntax highlighting pulls its settings from XML lang files, although the Ruby lang file should automatically pick up on .rb files. To check, open the language file from /usr/share/gtksourceview-2.0/language-specs/ruby.lang and see if *.rb is mentioned.

<property name="globs">*.rb</property>

Adding more Ruby extensions to the lang files: http://blog.adsdevshop.com/2008/04/19/erb-syntax-highlighting-in-gedit/

Al
Yeah, I've done that but it is not still not automatically working with Ruby files. I've noticed that the syntax highlighting is working automatically for other languages.
wildster
A: 

Try opening up /usr/share/gtksourceview-2.0/language-specs/ruby.lang again and addding this line at the top of the section:

<property name="mimetypes=">application/x-ruby</property>

If that doesn't work, I'm stumped.

sh228
A: 

Try to edit your /etc/mime.types file and add those “text/x-????” entries:

  text/x-ruby-source                              rhtml html.erb erb
  text/x-eruby                                    rjs
  text/x-yaml                                     yml yaml
Andión