Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax highlighting in gedit not working automatically

Tags:

ruby

gedit

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?

like image 895
kieranwild Avatar asked Mar 24 '26 02:03

kieranwild


2 Answers

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
like image 134
Andión Avatar answered Mar 26 '26 18:03

Andión


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.

like image 41
sh228 Avatar answered Mar 26 '26 18:03

sh228