How To Add a File Extension to gEdit in Ubuntu

While working on Zope Server and Plone I needed to open .zcml files with XML syntax highlighting in gEdit. After searching a little bit I found how to do it.

Open file /usr/share/mime/packages/freedesktop.org.xml, search for application/xml then add <glob pattern="*.zcml"/>. File should now look like:

  <mime-type type="application/xml">
...
<glob pattern="*.zcml"/>
...
</mime-type>

Then run from a terminal:

$ sudo update-mime-database /usr/share/mime

Restart gedit and you should be able to open zcml files with XML syntax highlighting.

Danilo