[Sussex] Gedit syntax highlighting

Geoffrey J. Teale gteale at cmedresearch.com
Fri Jun 10 09:10:53 UTC 2005


Ronan Chilvers <ronan at thelittledot.com> writes:

> Hi folks
>
> Anyone out there use GEdit?  I'm trying to find out how to edit the
> syntax highlighting parameters it uses.  Specifically I want to add
> some entries to the list of file extensions used to identify file
> types.  For example, when using smarty (php templating engine), my
> templates are HTML with some smarty directives in it.  I want them
> highlighted as HTML, but the file extension is .tpl and so gedit
> doesn't pick it up.  Had a look at the language spec files in /usr/
> share/gtksourceview/lang-specs but the file extensions aren't specified
> in there.  Anyone know if this is possible?  I'm using gedit 2.10
> (ubuntu apt-getted to the max!!).

If you look at those langspecs you'll see they decide based on the
mime-type of the files.  Near the top is a line like this:

<language _name="C" version="1.0" _section="Sources" mimetypes="text/x-c;text/x-chdr;text/x-csrc">

...Just add the appropriate mime type to the list.

Or switch to GNU Emacs and I'll explain how you can achieve this in a
_real_ text editing environment :-)  


-- 
Geoff Teale
Cmed Technology            -   gteale at cmedresearch.com
Free Software Foundation   -   tealeg at member.fsf.org




More information about the Sussex mailing list