Guest User

Untitled

a guest
Jan 10th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. # GTK - The GIMP Toolkit
  2. # Copyright (C) 2002 Owen Taylor
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public
  6. # License as published by the Free Software Foundation; either
  7. # version 2 of the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the
  16. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. # Boston, MA 02111-1307, USA.
  18.  
  19.  
  20. # Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. # file for a list of people on the GTK+ Team. See the ChangeLog
  22. # files for a list of changes. These files are distributed with
  23. # GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24.  
  25.  
  26. #
  27. # A keybinding set implementing emacs-like keybindings
  28. #
  29.  
  30. #
  31. # Bindings for GtkTextView and GtkEntry
  32. #
  33. binding "gtk-emacs-text-entry"
  34. {
  35. bind "<alt>j" { "move-cursor" (logical-positions, -1, 0) }
  36. bind "<shift><alt>j" { "move-cursor" (logical-positions, -1, 1) }
  37. bind "<alt>l" { "move-cursor" (logical-positions, 1, 0) }
  38. bind "<shift><alt>l" { "move-cursor" (logical-positions, 1, 1) }
  39.  
  40. bind "<alt>u" { "move-cursor" (words, -1, 0) }
  41. bind "<shift><alt>u" { "move-cursor" (words, -1, 1) }
  42. bind "<alt>o" { "move-cursor" (words, 1, 0) }
  43. bind "<shift><alt>o" { "move-cursor" (words, 1, 1) }
  44.  
  45. bind "<alt>h" { "move-cursor" (paragraph-ends, -1, 0) }
  46. bind "<shift><alt>h" { "move-cursor" (paragraph-ends, -1, 1) }
  47. bind "<alt>semicolon" { "move-cursor" (paragraph-ends, 1, 0) }
  48. bind "<shift><alt>semicolon" { "move-cursor" (paragraph-ends, 1, 1) }
  49.  
  50. bind "<ctrl>x" { "cut-clipboard" () }
  51. bind "<ctrl>v" { "paste-clipboard" () }
  52.  
  53. bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) }
  54. bind "<ctrl>space" { "set-anchor" () }
  55.  
  56. bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
  57. bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
  58. bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }
  59. bind "<shift><alt>backslash" { "delete-from-cursor" (whitespace, 1) }
  60.  
  61. bind "<alt>backslash" { "delete-from-cursor" (whitespace, 1)
  62. "insert-at-cursor" (" ") }
  63.  
  64.  
  65. #
  66. # Some non-Emacs keybindings people are attached to
  67. #
  68. bind "<ctrl>u" {
  69. "move-cursor" (paragraph-ends, -1, 0)
  70. "delete-from-cursor" (paragraph-ends, 1)
  71. }
  72. }
  73.  
  74. #
  75. # Bindings for GtkTextView
  76. #
  77. binding "gtk-emacs-text-view"
  78. {
  79. bind "<alt>i" { "move-cursor" (display-lines, -1, 0) }
  80. bind "<shift><alt>i" { "move-cursor" (display-lines, -1, 1) }
  81. bind "<alt>k" { "move-cursor" (display-lines, 1, 0) }
  82. bind "<shift><alt>k" { "move-cursor" (display-lines, 1, 1) }
  83.  
  84. bind "<ctrl>space" { "set-anchor" () }
  85. bind "<ctrl>KP_Space" { "set-anchor" () }
  86. }
  87.  
  88. #
  89. # Bindings for GtkTreeView
  90. #
  91. binding "gtk-emacs-tree-view"
  92. {
  93. bind "<ctrl>f" { "start-interactive-search" () }
  94. bind "<alt>l" { "move-cursor" (logical-positions, 1) }
  95. bind "<alt>j" { "move-cursor" (logical-positions, -1) }
  96. }
  97.  
  98. #
  99. # Bindings for menus
  100. #
  101. binding "gtk-emacs-menu"
  102. {
  103. bind "<alt>k" { "move-current" (next) }
  104. bind "<alt>i" { "move-current" (prev) }
  105. bind "<alt>l" { "move-current" (child) }
  106. bind "<alt>j" { "move-current" (parent) }
  107. }
  108.  
  109. class "GtkEntry" binding "gtk-emacs-text-entry"
  110. class "GtkTextView" binding "gtk-emacs-text-entry"
  111. class "GtkTextView" binding "gtk-emacs-text-view"
  112. class "GtkTreeView" binding "gtk-emacs-tree-view"
  113. class "GtkMenuShell" binding "gtk-emacs-menu"
Advertisement
Add Comment
Please, Sign In to add comment