I know this is late but...Fist, create a desktop file in ~/.local/share/applications/
for example sublime.desktop
would be something like ~/.local/share/applications/sublime.desktop with the following content:
[Desktop Entry]
Keywords=Plaintext;Write;Programming;Syntax;Ruby;HTML
Categories=;
Comment=sublime
Exec=sublime_text %U
Hidden=false
Icon=icon-name
Name=sublime
Terminal=false
Type=Application
Version=1.0
StartupNotify=true
MimeType=text/plain;text/html;application/ruby;
Then... if you edit ~/.local/share/applications/mimeapps.list
you will see the content type text/html edit it like so:
[Default Applications]
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
text/html=sublime.desktop
application/x-extension-htm=sublime.desktop
application/x-extension-html=sublime.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop
[Added Associations]
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;
application/x-yaml=sublime-1.desktop;
[Removed Associations]
text/html=firefox.desktop;gedit.desktop;
You can of-course change as many or as little as you want and you can also add as many or as little as you want to the desktop files MimeType for example application/python
, application/x-ruby
, text/ruby
, text/x-python
or dozens of other variants... though sticking to simple types should be alright for example application/python
and application/ruby
both work on my GNOME 3.2 install.