Blame gtk/gtkrc.key.emacs

Packit 98cdb6
# GTK - The GIMP Toolkit
Packit 98cdb6
# Copyright (C) 2002 Owen Taylor
Packit 98cdb6
#
Packit 98cdb6
# This library is free software; you can redistribute it and/or
Packit 98cdb6
# modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
# License as published by the Free Software Foundation; either
Packit 98cdb6
# version 2 of the License, or (at your option) any later version.
Packit 98cdb6
#
Packit 98cdb6
# This library is distributed in the hope that it will be useful,
Packit 98cdb6
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
# Lesser General Public License for more details.
Packit 98cdb6
#
Packit 98cdb6
# You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
# License along with this library; if not, write to the
Packit 98cdb6
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
# Boston, MA 02111-1307, USA.
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
# Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit 98cdb6
# file for a list of people on the GTK+ Team.  See the ChangeLog
Packit 98cdb6
# files for a list of changes.  These files are distributed with
Packit 98cdb6
# GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#
Packit 98cdb6
# A keybinding set implementing emacs-like keybindings
Packit 98cdb6
#
Packit 98cdb6
Packit 98cdb6
#
Packit 98cdb6
# Bindings for GtkTextView and GtkEntry
Packit 98cdb6
#
Packit 98cdb6
binding "gtk-emacs-text-entry"
Packit 98cdb6
{
Packit 98cdb6
  bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) }
Packit 98cdb6
  bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) }
Packit 98cdb6
Packit 98cdb6
  bind "<alt>b" { "move-cursor" (words, -1, 0) }
Packit 98cdb6
  bind "<shift><alt>b" { "move-cursor" (words, -1, 1) }
Packit 98cdb6
  bind "<alt>f" { "move-cursor" (words, 1, 0) }
Packit 98cdb6
  bind "<shift><alt>f" { "move-cursor" (words, 1, 1) }
Packit 98cdb6
Packit 98cdb6
  bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) }
Packit 98cdb6
  bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) }
Packit 98cdb6
Packit 98cdb6
  bind "<ctrl>w" { "cut-clipboard" () }
Packit 98cdb6
  bind "<ctrl>y" { "paste-clipboard" () }
Packit 98cdb6
Packit 98cdb6
  bind "<ctrl>d" { "delete-from-cursor" (chars, 1) }
Packit 98cdb6
  bind "<alt>d" { "delete-from-cursor" (word-ends, 1) }
Packit 98cdb6
  bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) }
Packit 98cdb6
  bind "<alt>backslash" { "delete-from-cursor" (whitespace, 1) }
Packit 98cdb6
Packit 98cdb6
  bind "<alt>space" { "delete-from-cursor" (whitespace, 1)
Packit 98cdb6
                      "insert-at-cursor" (" ") }
Packit 98cdb6
  bind "<alt>KP_Space" { "delete-from-cursor" (whitespace, 1)
Packit 98cdb6
                         "insert-at-cursor" (" ")  }
Packit 98cdb6
Packit 98cdb6
  #
Packit 98cdb6
  # Some non-Emacs keybindings people are attached to
Packit 98cdb6
  #
Packit 98cdb6
  bind "<ctrl>u" {
Packit 98cdb6
     "move-cursor" (paragraph-ends, -1, 0)
Packit 98cdb6
     "delete-from-cursor" (paragraph-ends, 1)
Packit 98cdb6
  }
Packit 98cdb6
  bind "<ctrl>h" { "delete-from-cursor" (chars, -1) }
Packit 98cdb6
  bind "<ctrl>w" { "delete-from-cursor" (word-ends, -1) }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
#
Packit 98cdb6
# Bindings for GtkTextView
Packit 98cdb6
#
Packit 98cdb6
binding "gtk-emacs-text-view"
Packit 98cdb6
{
Packit 98cdb6
  bind "<ctrl>p" { "move-cursor" (display-lines, -1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>p" { "move-cursor" (display-lines, -1, 1) }
Packit 98cdb6
  bind "<ctrl>n" { "move-cursor" (display-lines, 1, 0) }
Packit 98cdb6
  bind "<shift><ctrl>n" { "move-cursor" (display-lines, 1, 1) }
Packit 98cdb6
Packit 98cdb6
  bind "<ctrl>space" { "set-anchor" () }
Packit 98cdb6
  bind "<ctrl>KP_Space" { "set-anchor" () }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
#
Packit 98cdb6
# Bindings for GtkTreeView
Packit 98cdb6
#
Packit 98cdb6
binding "gtk-emacs-tree-view"
Packit 98cdb6
{
Packit 98cdb6
  bind "<ctrl>s" { "start-interactive-search" () }
Packit 98cdb6
  bind "<ctrl>f" { "move-cursor" (logical-positions, 1) }
Packit 98cdb6
  bind "<ctrl>b" { "move-cursor" (logical-positions, -1) }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
#
Packit 98cdb6
# Bindings for menus
Packit 98cdb6
#
Packit 98cdb6
binding "gtk-emacs-menu"
Packit 98cdb6
{
Packit 98cdb6
  bind "<ctrl>n" { "move-current" (next) }
Packit 98cdb6
  bind "<ctrl>p" { "move-current" (prev) }
Packit 98cdb6
  bind "<ctrl>f" { "move-current" (child) }
Packit 98cdb6
  bind "<ctrl>b" { "move-current" (parent) }
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
class "GtkEntry" binding "gtk-emacs-text-entry"
Packit 98cdb6
class "GtkTextView" binding "gtk-emacs-text-entry"
Packit 98cdb6
class "GtkTextView" binding "gtk-emacs-text-view"
Packit 98cdb6
class "GtkTreeView" binding "gtk-emacs-tree-view"
Packit 98cdb6
class "GtkMenuShell" binding "gtk-emacs-menu"