Configuring Gedit for Rails
I haven’t kept my feelings about IDEs hidden, I’m a big believer in using text editors instead.
I know, I should earn my chops and become a Vim guy, and some day I hope to sit down and make that conversion, but for now it’s all about Gedit for me. With a few plugins and a little TLC gedit can be a lighter version of the more powerful, more intensive ide.
The first thing we’re going to install gMate, an addon designed to make Gedit run like TextMate
sudo add-apt-repository ppa:ubuntu-on-rails/ppa sudo apt-get update
sudo apt-get install gedit-gmate
Additionally we’re going to install the standard plugins package
sudo apt-get install gedit-plugins
Now lets fire up Gedit and turn on our preferences.
To get to our plugins go to Edit > Preferences > Plugins.
We’re going to enable the following options:
- Code Comment
- Embedded Terminal
- Find in Files
- Rails Extract Partial
- Rails File Loader
- Session Saver (Optional)
- Smart Indent (Optional)
- Tab Switch (Optional)
- TextMate Style AutoCompletion
This is going to enable a lot of different functionality, and while this is the setup I use, it may be more than you need.
Now if you’re in a ruby file and you type def, tabbing over will add the end and place you straight on the method name, control+tab will switch between documents, and syntax highlighting will work correctly in html.erb files.
Also, going to view > bottom pane will display a terminal window that I find convenient for running irb.
While these instructions will enable a lot of different useful environments, and the target of this post was rails, I do have to sadly add that Google Go, which I cover quite often, does not, to my knowledge, have a plugin for Gedit currently.