Syntax highlighting in gedit not working automatically

烈酒焚心 提交于 2019-12-04 14:10:08

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

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.

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/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!