# # 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" (" ") } } # # 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" () } } class "GtkEntry" binding "gtk-emacs-text-entry" class "GtkTextView" binding "gtk-emacs-text-entry" class "GtkTextView" binding "gtk-emacs-text-view"