reStructuredText syntax highlighting in gedit

In howto on Nov 28, 2011 by theoryl Tagged: , , , , ,

A quick way to add reStructuredText syntax highlight to gedit 2.x is to “steal” from GMate, which consists of a set of plugins that makes gedit more similar to TextMate.

1. Download the .rst language specifications
2. Put it into /usr/share/gtksourceview-2.0/language-specs/
3. Create .local/share/mime/packages/rst.xml with

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="">
  <mime-type type="text/restructured">
    <alias type="text/x-rst" />
    <comment xml:lang="en">reStructuredText document</comment>
    <glob pattern="*.rst"/>

4. Do update-mime-database /usr/share/mime

That’s it. However, the syntax highlighting is quite limited (e.g. it doesn’t recognize directives, footnotes etc)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: