Enabling Emacs Keybindings in Gnome

A while back I discovered a post on someone’s blog that talked about using Emacs key bindings in bash. Since then my efficiency in bash has gone up drastically as these key bindings are second nature to me. This is definitely one of those cases where you wish you could go back in time to tell yourself something because you discovered it much too late in life. Today I learned this can be taken a step further. If you use Gnome as your window manager you can enable it to use the emacs key bindings as well. This will work for any Gnome applications that were built using GTK.

At one point in time these bindings were enabled by default, however they were eventually disabled in the default configuration. This was supposedly for the intent of simplifying Gnome. To re-enable these key bindings hit F2 and enter gconf-editor or you can also enter it into the shell. For those not familiar with gconf, it’s similar to Windows Registry but a lot less temperamental and cluttered. Navigate to /desktop/gnome/interface/gtk_key_theme and change the entry from Default to Emacs and close gconf-editor. The change should be immediate, however some applications will pick up the change immediately. To test it out, start up Firefox and try doing a kill (c+k) and then yank (c+y), it should work just as it would within emacs.


Tags: , , , , , ,

  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

4 Responses to “Enabling Emacs Keybindings in Gnome”

  1. Gaurav says:

    Brilliant!!! THANKS!!!!!!!!!!!!

  2. Claude says:

    Yes, but how do you do this automatically so that you can run a script after you install and get this configuration setting, as well as others, without having to run several GUI based commands? That’s the point of *nix systems, no?

  3. Claude says:

    OK, I found the solution I think. You can either use this

    gconftool-2 –set /desktop/gnome/interface/gtk_key_theme Emacs –type string

    or visit this site :

    http://kb.mozillazine.org/Emacs_Keybindings_%28Firefox%29

    Pax!

Leave a Reply