How To Add a File Extension to gEdit in Ubuntu


This entry was written more than 1 year ago. Please read the article keeping in mind its age.

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/, search for application/xml then add <glob pattern="*.zcml"/>. File should now look like:

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

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.