# Based on /usr/share/themes/Emacs/gtk-2.0-key/, # modified by Zack for matita # # A keybinding set implementing emacs-like keybindings # # # Bindings for GtkTextView and GtkEntry # binding "gtk-emacs-text-entry" { bind "b" { "move-cursor" (logical-positions, -1, 0) } bind "b" { "move-cursor" (logical-positions, -1, 1) } bind "f" { "move-cursor" (logical-positions, 1, 0) } bind "f" { "move-cursor" (logical-positions, 1, 1) } bind "b" { "move-cursor" (words, -1, 0) } bind "b" { "move-cursor" (words, -1, 1) } bind "f" { "move-cursor" (words, 1, 0) } bind "f" { "move-cursor" (words, 1, 1) } bind "a" { "move-cursor" (paragraph-ends, -1, 0) } bind "a" { "move-cursor" (paragraph-ends, -1, 1) } bind "e" { "move-cursor" (paragraph-ends, 1, 0) } bind "e" { "move-cursor" (paragraph-ends, 1, 1) } bind "w" { "cut-clipboard" () } bind "y" { "paste-clipboard" () } bind "d" { "delete-from-cursor" (chars, 1) } bind "d" { "delete-from-cursor" (word-ends, 1) } bind "k" { "delete-from-cursor" (paragraph-ends, 1) } bind "backslash" { "delete-from-cursor" (whitespace, 1) } bind "space" { "delete-from-cursor" (whitespace, 1) "insert-at-cursor" (" ") } bind "KP_Space" { "delete-from-cursor" (whitespace, 1) "insert-at-cursor" (" ") } # # Some non-Emacs keybindings people are attached to # bind "u" { "move-cursor" (paragraph-ends, -1, 0) "delete-from-cursor" (paragraph-ends, 1) } bind "h" { "delete-from-cursor" (chars, -1) } bind "w" { "delete-from-cursor" (word-ends, -1) } } # # Bindings for GtkTextView # binding "gtk-emacs-text-view" { # bind "p" { "move-cursor" (display-lines, -1, 0) } bind "p" { "move-cursor" (display-lines, -1, 1) } # bind "n" { "move-cursor" (display-lines, 1, 0) } bind "n" { "move-cursor" (display-lines, 1, 1) } bind "space" { "set-anchor" () } bind "KP_Space" { "set-anchor" () } } # # Bindings for GtkTreeView # binding "gtk-emacs-tree-view" { bind "s" { "start-interactive-search" () } bind "f" { "move-cursor" (logical-positions, 1) } bind "b" { "move-cursor" (logical-positions, -1) } } class "GtkEntry" binding "gtk-emacs-text-entry" class "GtkTextView" binding "gtk-emacs-text-entry" class "GtkTextView" binding "gtk-emacs-text-view" class "GtkTreeView" binding "gtk-emacs-tree-view"