There are already a couple of manuals out there that describe how to make Gedit fit for development in Ruby (or other languages). See here or here for example.
Unfortunately many plugins no longer work with newer Gedit versions, since 3.8 there were some fundamental changes.
So the recent Gedit were less useless and I already decided to move to vim due to all this shortcomings.
But after having a closer look at the plugin list at the Gnome wiki I came to quite good results with Gedit 3.10. It seems quite a few plugins have appeared that replace the old ones and also Gedit bugs have been fixed.
In order to help setting it up here a quick manual.
First of all install
gedit and the
gedit-plugin package on your system. Then add the following 3rd party plugins:
- Pair character autocompletion* – this plugin closes parenthesis and brackets, also around marked text. Hence much better then the default plugin.
- Smart Highlighting – Highlight occurrences of current selected text.
- Trailsave – deletes trailing whitespaces when saving a file.
To install plugins move the necessary files to
~/.local/share/gedit/plugins/and then restart gedit. For the rest of the setup we'll use the plugins distributed with gedit packages.
To get a decent development editor you should at least enable following plugins (
Edit > Preferences > Plugins Tab):
- Code Comment – allows to comment/uncomment multiple lines with
Ctrl. + M(
+ Shiftfor inverse behaviour)
- Draw space – as spaces are used in ruby instead of tab displaying spaces helps to easily see intendation and also to spot uncommon characters and trailing whitespaces in your code.
- File Browser Panel – on by default, display the sidepane in the view menu.
- Multi edit – if you want to edit multiple places at once
- Pair character completion – the plugin installed above to comeplete closing characters. Use this instead of the build in plugin (called Braket Copletion), since it allows to mark text first.
- Quick open – helpfull to open files fast by pressing
Ctrl. + Alt + Oand type.
- Smart highlighting – Plugin installed above, helpfull to find same words in a document.
- Snippets – easily missed but quite powerful in completing code structures. In ruby code for example just write
Taband it will create a template of a method for you
- Sort – for sorting listings.
- Trailsave – the plugin installed above. Deletes trailing whitespaces.
- Word completion – just a common completion of existing words.
To finish your setup you might want to change some settings in the
Edit > Preferenceswindow:
- Display line numbers
- Display right margin at column 80
- Disable text wrapping
- Highlight matching brackets
- For Ruby set tab with 2 and insert spaces instead of tabs
- Enable automatic intendation
- Disable backup file creation and autosave (as you proably work with a version control system anyway)
- As color theme I prefer Oblivion
- As Font I just use the system font, which is set to Ubuntu Mono 11 in my case.
After all this you should end up with a pretty decent development editor.
* the pair char completion plugin has an issue when used in combination with the word autocomplete. When you press enter there a linebreak instead the autocomplete. I fixed this an provide it for download here.