GEdit plugin formatting Ruby and ERB code now!

I have published some time ago a GEdit plugin for formatting Ruby code.

Now I just updated the plugin and added support for formatting html.erb and .xml.erb files too.

The main idea  is to make this plugin a generic language code formatter for GEdit, contributions are welcome.

As told before, to install it, grab the source from GitHub and copy all files to ~/.gnome2/gedit/plugins.

To download the files using Git use the following command line:

git clone git://github.com/urubatan/gedit_formatter.git

If you want to contribute just send a pull request in GitHub or send me a patch by e-mail.

To use the plugin, just press CTRL+ALT+F after installing and enabling it.

If you do not have git installed, you can download a tarbal with the latest sources from this link.

If you enjoyed this post, make sure you subscribe to my RSS feed!

GEdit plugin for formatting ruby code


I work with Java for a long time, and I’m used to Eclipse facilities, but to work with ruby on rails I think an IDE is not needed, I work better with GEdit (or even VIM, depends on my humor) than ith NetBeans or Aptana.
But there are some features of an IDE that I miss when working with GEdit, for example code formatting.
As a heavy eclipse user, I prefer to let eclipse take care of the indentation of my source files …
So I have created this GEdit plugin to format ruby files, if you want to use it, just checkout the source code from GitHub and copy all files to ~/.gnome2/gedit/plugins, restart gedit and you are ready to go …
After reopening GEdit, click Edit\Preferences\plugins and enable the “Code Formatter” plugin.
then, when you are editing a ruby file, just click CTRL+ALT+F and the code will be formatted for you.
if you are more a mouse gui, just click Tools\Format Code.

I hope this plugin can be useful for others too.
I plan to add support for more languages, for example XHTML and RHTML (ERB + XHTML), I know tidy plugin can do this, but I do not like the default tidy configuration, but will probably use tidy as a backend to this feature :D

to checkout the code, you can download the zip file available in the project page, or use git:

git clone git://github.com/urubatan/gedit_formatter.git

Any doubts, problems or tips for improvements just leave a comment, here or in github.

PS.: this was my first GEdit plugin, and my first experience with python, the code can be improved a lot, any comments about that are very welcome.

If you enjoyed this post, make sure you subscribe to my RSS feed!