;;; viper-keym.el --- Viper keymaps
;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
"Auxiliary map for global user-defined bindings in Emacs state.")
(defvar viper-emacs-kbd-map (make-sparse-keymap)
- "This keymap keeps Vi-style kbd macros for emacs mode.")
+ "This keymap keeps Vi-style kbd macros for Emacs mode.")
(viper-deflocalvar viper-emacs-local-user-map (make-sparse-keymap)
"Auxiliary map for local user-defined bindings in Emacs state.")
;; Some important keys used in viper
(defcustom viper-toggle-key [(control ?z)] ; "\C-z"
- "The key used to change states from emacs to Vi and back.
+ "The key used to change states from Emacs to Vi and back.
In insert mode, this key also functions as Meta.
-Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
+Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
:type 'sexp
:group 'viper
:set (lambda (symbol value)
:type 'string
:group 'viper)
-(defcustom viper-ESC-key [(escape)] ; "\e"
+(defcustom viper-ESC-key (if (viper-window-display-p) [(escape)] "\e")
"Key used to ESC.
-Enter as a sexp. Examples: \"\\e\", [(escape)]."
+Enter as a sexp. Examples: \"\\e\", [(escape)].
+If running in a terminal, [(escape)] is not understood, so must use \"\\e\"."
:type 'sexp
:group 'viper
:set (lambda (symbol value)
(define-key viper-insert-basic-map "\C-d" 'viper-backward-indent)
(define-key viper-insert-basic-map "\C-w" 'viper-delete-backward-word)
(define-key viper-insert-basic-map "\C-t" 'viper-forward-indent)
-(define-key viper-insert-basic-map
- (if viper-xemacs-p [(shift tab)] [S-tab]) 'viper-insert-tab)
(define-key viper-insert-basic-map viper-quoted-insert-key 'quoted-insert)
(define-key viper-insert-basic-map "\C-?" 'viper-del-backward-char-in-insert)
(define-key viper-insert-basic-map [backspace] 'viper-del-backward-char-in-insert)