emacs keybindings in firefox

Use Firefox on *nix? Want Emacs key bindings in text fields? As described in the MozillaZine knowledge base, add this to your ~/.gtkrc-2.0 file.

gtk-key-theme-name = "Emacs"

This will give you many Emacs key bindings, specifically C-a, C-e, C-f, C-b, C-k, C-u, C-w, C-h, and C-d. However, you won’t get C-y, C-p, C-n, C-s, C-r, C-j, C-m, and C-l, since they’re overridden by menu item accelerators.

To get those key bindings too, go to about:config and set ui.key.accelKey to 18. This switches Firefox’s accelerator key from Ctrl to Alt. So, you’ll need to use Alt-L to go to the URL box, Alt-T to open a new tab, etc…but you’ll be able to use all the Emacs keybindings burned into your muscle memory!

Thanks to David Chandler for this tip.

6 thoughts on “emacs keybindings in firefox

  1. Changing accelKey to 18 doesn’t seem to enable the extra emacs keys (Firefox 1.5.0.7 on Ubuntu Linux).

  2. For some reason, editing the .gtkrc-2.0 file doesn’t work for me in Gnome 2.14. However, I found an even easier way to do it. Just run this command:


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


    (You can use –unset if you decide you don’t like it).

    –b9

Leave a Reply

Your email address will not be published.