Skip to content

Instantly share code, notes, and snippets.

@doitian
Created December 30, 2011 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doitian/1538492 to your computer and use it in GitHub Desktop.
Save doitian/1538492 to your computer and use it in GitHub Desktop.
Bind keys for chromium omnibar
binding "gtk-binding-text" {
bind "<alt>n" { "move-cursor" (display-lines, 1, 0) }
bind "<alt>p" { "move-cursor" (display-lines, -1, 0) }
bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) }
}
class "GtkEntry" binding "gtk-binding-text"
class "GtkTextView" binding "gtk-binding-text"

Or you can enable emacs keybinding in all gtk-2 apps

  1. Add following line in .gtkrc-2.0

    gtk-key-theme-name = "Emacs"
    
  2. And run following command

    $ gconftool -t string --set /desktop/gnome/interface/gtk_key_theme Emacs
    

To restore, just remove that line in .gtkrc-2.0 and run

$ gconftool -t string --set /desktop/gnome/interface/gtk_key_theme Default
@doitian
Copy link
Author

doitian commented Dec 30, 2011

Do use chromium, I have tried google chrome dev chanel, it still does not obey your gtk keybinding configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment