summaryrefslogtreecommitdiff
path: root/gtk/gtkrc.key.emacs
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-09 00:19:29 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-09 00:19:29 +0000
commit7b79dfbef85c458a1d4d89b3092312b9c09245ba (patch)
treed9d374082c85fb6324e9a59c2d270c810b070fec /gtk/gtkrc.key.emacs
parent6c07eadbbebbb97a104f20834c0c89c2800c46ad (diff)
downloadgtk+-7b79dfbef85c458a1d4d89b3092312b9c09245ba.tar.gz
Add a function to delete all bindings add by gtk_binding_parse_binding()
Fri Feb 8 18:46:13 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkbindings.[ch] (_gtk_binding_reset_parsed): Add a function to delete all bindings add by gtk_binding_parse_binding() when rereading RC files. * gtk/gtkrc.c (gtk_rc_reparse_all_for_settings): Reset binding set content as well as RC content. * gtk/gtkbindings.c (binding_compose_params): Fix various GValue handling problems. * gtk/gtkentry.c (gtk_entry_class_init): Remove bindings for C-b, C-f, M-b, M-f, C-a, C-e, C-w, C-y, M-space, C-u, C-k, M-\, M-d, C-d. * gtk/gtktextview.c (gtk_text_view_class_init): Remove same bindings as GtkEntry, plus C-n, C-p, C-space * gtk/gtkrc.key.default gtk/gtkrc.key.emacs gtk/Makefile.am: Add Emacs and Default key themes.
Diffstat (limited to 'gtk/gtkrc.key.emacs')
-rw-r--r--gtk/gtkrc.key.emacs55
1 files changed, 55 insertions, 0 deletions
diff --git a/gtk/gtkrc.key.emacs b/gtk/gtkrc.key.emacs
new file mode 100644
index 0000000000..ce5e737c2a
--- /dev/null
+++ b/gtk/gtkrc.key.emacs
@@ -0,0 +1,55 @@
+#
+# A keybinding set implementing emacs-like keybindings
+#
+
+#
+# Bindings for GtkTextView and GtkEntry
+#
+binding "gtk-emacs-text-entry"
+{
+ bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) }
+ bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) }
+ bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) }
+ bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) }
+
+ bind "<alt>b" { "move-cursor" (words, -1, 0) }
+ bind "<shift><alt>b" { "move-cursor" (words, -1, 1) }
+ bind "<alt>f" { "move-cursor" (words, 1, 0) }
+ bind "<shift><alt>f" { "move-cursor" (words, 1, 1) }
+
+ bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) }
+ bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) }
+ bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
+ bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) }
+
+ bind "<ctrl>w" { "cut-clipboard" () }
+ bind "<ctrl>y" { "paste-clipboard" () }
+
+ bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
+ bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
+ bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }
+ bind "<alt>backslash" { "delete-from-cursor" (whitespace, 1) }
+
+ bind "<alt>space" { "delete-from-cursor" (whitespace, 1)
+ "insert-at-cursor" (" ") }
+ bind "<alt>KP_Space" { "delete-from-cursor" (whitespace, 1)
+ "insert-at-cursor" (" ") }
+}
+
+#
+# Bindings for GtkTextView
+#
+binding "gtk-emacs-text-view"
+{
+ bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
+ bind "<shift><ctrl>p" { "move-cursor" (display-lines, -1, 1) }
+ bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
+ bind "<shift><ctrl>n" { "move-cursor" (display-lines, 1, 1) }
+
+ bind "<ctrl>space" { "set-anchor" () }
+ bind "<ctrl>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"