]> Pileus Git - ~andy/gtk/blob - gtk/gtkrc.key.emacs
Flip the padding
[~andy/gtk] / gtk / gtkrc.key.emacs
1 #
2 # A keybinding set implementing emacs-like keybindings
3 #
4
5 #
6 # Bindings for GtkTextView and GtkEntry
7 #
8 binding "gtk-emacs-text-entry"
9 {
10   bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) }
11   bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) }
12   bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) }
13   bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) }
14
15   bind "<alt>b" { "move-cursor" (words, -1, 0) }
16   bind "<shift><alt>b" { "move-cursor" (words, -1, 1) }
17   bind "<alt>f" { "move-cursor" (words, 1, 0) }
18   bind "<shift><alt>f" { "move-cursor" (words, 1, 1) }
19
20   bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) }
21   bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) }
22   bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
23   bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) }
24
25   bind "<ctrl>w" { "cut-clipboard" () }
26   bind "<ctrl>y" { "paste-clipboard" () }
27
28   bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
29   bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
30   bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }
31   bind "<alt>backslash" { "delete-from-cursor" (whitespace, 1) }
32
33   bind "<alt>space" { "delete-from-cursor" (whitespace, 1)
34                       "insert-at-cursor" (" ") }
35   bind "<alt>KP_Space" { "delete-from-cursor" (whitespace, 1)
36                          "insert-at-cursor" (" ")  }
37
38   #
39   # Some non-Emacs keybindings people are attached to
40   #
41   bind "<ctrl>u" {
42      "move-cursor" (paragraph-ends, -1, 0)
43      "delete-from-cursor" (paragraph-ends, 1)
44   }
45   bind "<ctrl>h" { "delete-from-cursor" (chars, -1) }
46   bind "<ctrl>w" { "delete-from-cursor" (word-ends, -1) }
47 }
48
49 #
50 # Bindings for GtkTextView
51 #
52 binding "gtk-emacs-text-view"
53 {
54   bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
55   bind "<shift><ctrl>p" { "move-cursor" (display-lines, -1, 1) }
56   bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
57   bind "<shift><ctrl>n" { "move-cursor" (display-lines, 1, 1) }
58
59   bind "<ctrl>space" { "set-anchor" () }
60   bind "<ctrl>KP_Space" { "set-anchor" () }
61 }
62
63 #
64 # Bindings for GtkTreeView
65 #
66 binding "gtk-emacs-tree-view"
67 {
68   bind "<ctrl>s" { "start-interactive-search" () }
69   bind "<ctrl>f" { "move-cursor" (logical-positions, 1) }
70   bind "<ctrl>b" { "move-cursor" (logical-positions, -1) }
71 }
72
73 class "GtkEntry" binding "gtk-emacs-text-entry"
74 class "GtkTextView" binding "gtk-emacs-text-entry"
75 class "GtkTextView" binding "gtk-emacs-text-view"
76 class "GtkTreeView" binding "gtk-emacs-tree-view"