Textmate-like Gedit in few steps

UPDATE: A !! new version !! of this guide is avalaible.
UPDATE: This guide was for gedit 2.18.x, please upgrade to gedit 2.20.x to have an easier color scheme managing. Textmate is really a great text-editor (almost an IDE but faster), it has even the support for latest Ruby/Rails technologies like RSpec. On the GNU/Linux side there are also similar full-featured text editor and one is Gedit.

Gedit can be extended by plugins written in C or in Python, here is a tutorial how to set up a Textmate-like Gedit.

Syntax highlight for RHTML, RJS

By default Gedit supports a lot of languages php, C#, java,.. and Ruby, but Ruby embedded. To enable the sintax highlight in HTML files with embedded ruby code (.rhtml) you have to add 2 files (Thanks to Bitsbam).

From the terminal:

$ wget http://grigio.org/files/x-rhtml.xml; sudo mv x-rhtml.xml /usr/share/mime/packages
$ wget http://grigio.org/files/rhtml.lang;  sudo mv rhtml.lang /usr/share/gtksourceview-1.0/language-specs/

Select the plugin you need

The list of the plugins avalaible is growing fast; this is a list of plugins that work well each other.

Snippets: it permits to call structures of code easly and everytime you press TAB the cursor automatically jumps to the right position
Snap Open
: it opens the files that contains the word you are typing

File Browser: a treeview of the files in the current directory
Word completion: it complete the word while you are typing and with TAB you select it

Class Browser: a list with all the methods in the current file
Quick Highlight Mode: very useful to specify quickly the syntax mode

Interesting resources

All the plugins are avalaible from the GNOME Wiki.
If you want User-defined syntax color, snippets, .. you can download them from here

UPDATE: My color scheme is here (It's ONLY for gedit 2.18.x), uncompress it in $HOME/.gconf/apps/gedit-2/preferences/syntax_highlighting  and restart  the session. Be sure that the folder exists and that your previos files are  overwritten.


If you wan to pass HP0-J25 exam with promising success, check out our latest collection of braindump prepared by certified experts plus get free sample questions for 1Y0-A08.



Nice skin! what theme are you using in your os? the fonts look awesome could you share that with us?

Project for it?

Hi! Does anybody know a project that compiles all this stuff to easily distribute a textmate-like version of gedit?

I'm thinking about starting this, if it not exists. If it exisits, I'd like to contribute...

Please send me any replies to lourenzo [at] gmail [dot] com


There is gedit-rails

..but it does different customizations.


Do you know how to get erb tags (<%= %>) highlighted with GTKsourceview-2.0 xml styles? Erb tags were highlighted in gedit on Feisty but not after I upgraded to Gutsy.


How do you get normal indentation?

How do you get normal indentation?
Using gedit, when I indent is the same as pressing tab - it just inserts a tab, regardless of the status.

I'm used to Emacs, where indenting is dependant on the syntax.

int i;

will not be indented in the same amount as

if(1) {
int i;

How do I do that with Gedit?

If I remember well, there is

If I remember well, there is a plugin for it, but if enabled it breaks snippets plugin..
If you want spaces instead of tabs you can set it from the preferences

Font and background settings.

Thanks for your post.

I got everything installed, but wondered what font and background colors you are using, and how to set them properly?

Thanks, John

Font & colors

Edit > Preferences > Font & Color
Background: #232323
Font: Consolas 11


Make sure to get the Classbrowser plugin from Subversion to get full Ruby (and RSpec) support. At least currently.



What is the GTK Them that you use in this screenshot ?



the theme is gummy, made by

the theme is gummy, made by Cimi

where is the folder for the syntax highlight?

btw, I am using ubuntu.
that's what I have:
inside editor i have:
auto_indent colors %gconf.xml right_margin tabs
bracket_matching current_line line_numbers save wrap_mode

Why are you inside editor?

Why are you inside editor? syntax_highlighting is in $HOME/.gconf/apps/gedit-2/preferences

i just described what folder i have inside the editor folder

in my /.gconf/apps/gedit-2/preferences
there are 2 folders: ui and editor.

after unzipping the file syntax_highlighting.tar.gz i get 2 folders: ruby and rhtml.
Am i suppose to create a folder inside preferences folder, rename it to syntax_highlighting and put inside
those folders (ruby and rhtml)?
I tried it but my gedit still showed me ruby and rhtml files with the default theme (white background)

What am I doing wrong?


I did exactly that and I am having the same issue. How do I get gedit to use the new syntax highlighting?


Yea i have the same problem too!!
Please help someone...

Darkmate for Gedit

Darkmate for Gedit 2.2x and other themes are avalaible on http://live.gnome.org/GtkSourceView/StyleSchemes
You just need to add an xml file.

Sorry, could you provide more details about the xml file?

I'm having the same issues as the other posters - i made a new folder called syntax_highlighting in gedit-2/preferences and untarred into there. But i can't get to the color scheme in gedit. What is the xml file you refer to?