emacs keybindings in firefox

gnu.jpg/space/firefox.png

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 Comments

  1. sam
    10/28/2006 #

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

  2. hackerb9
    12/4/2006 #

    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

  3. 12/15/2006 #

    Hey, you should check out Conkeror.

    Hardcore hacks for making firefox more emacs-like:

    http://conkeror.mozdev.org

  4. binor
    1/5/2009 #

    I highly recommend to check out vimperator!

    http://vimperator.org/trac/wiki/Vimperator

  5. binor
    1/5/2009 #

    ..in conjunction with firemacs for emacs bindings, of course.

    http://www.mew.org/~kazu/proj/firemacs/

  6. Memnon
    2/17/2010 #

    It’s all text:
    https://addons.mozilla.org/en-US/firefox/addon/4125

    Works for firefox and conkeror.

    This message was written in an emacsclient buffer ;)

Post a Comment

Post a comment...

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


  • home
    about
    pictures
    software
    index
    feed