Posts Tagged ‘gedit’

UTF-8 by default for gedit

Monday, January 14th, 2008

For a long time, I use UTF-8 for source files. But it isn’t the default charset encoding of my gnome environment.

GEdit tries to autodetect the encoding to be used and it works fine. But this feature don’t work with the Snap Open plugin. Each time, Snap Open opens a file .. I need to confirm the usage of UTF-8 :-(

I tested this week-end a small script wrapper to change the default charset encoding to UTF-8 before starting gedit :


#!/bin/sh
LC_CTYPE=en_US.UTF-8
export LC_CTYPE
/usr/bin/gedit $*

Here are several minutes saved per day :-)

Fix Rails Hotkeys underscore limitation

Friday, November 23rd, 2007

I’m using the Rails Hotkeys plugin for a moment in gedit. There is a small bug, a bit painful : if you’re editing a file customer_report.rb, Rails Hotkeys uses only customer as basename to open related file. So you’ll open customer.rb and not customer_report_test.rb :-(

Here is a small patch to fix Rails Hotkeys underscore limitation. The basename is now computed by removing only _controller, _test or _controller_test to the file basename.

If needed, the two lines to install :

cd ~/.gnome2/gedit/plugins/rails_hotkeys
patch < 2007-11-23-rails_hotkeys_underscore_limitation.patch