comparison lisp/emulation/vi.el @ 90133:4da4a09e8b1b

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-31 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 206-222) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 45-52) - Update from CVS - Update from CVS: texi Makefile.in CVS keyw cruft - Update from CVS: ChangeLog tweaks
author Miles Bader <miles@gnu.org>
date Thu, 31 Mar 2005 09:58:14 +0000
parents 68c22ea6027c 7160fe3a7ef1
children 01137c1fdbe9
comparison
equal deleted inserted replaced
90132:4080fe8b4f0f 90133:4da4a09e8b1b
1 ;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs 1 ;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs
2 2
3 ; This file is in the public domain because the authors distributed it 3 ;; This file is in the public domain because the authors distributed it
4 ; without a copyright notice before the US signed the Bern Convention. 4 ;; without a copyright notice before the US signed the Bern Convention.
5 5
6 ;; This file is part of GNU Emacs. 6 ;; This file is part of GNU Emacs.
7 7
8 ;; Author: Neal Ziring <nz@rsch.wisc.edu> 8 ;; Author: Neal Ziring <nz@rsch.wisc.edu>
9 ;; Felix S. T. Wu <wu@crys.wisc.edu> 9 ;; Felix S. T. Wu <wu@crys.wisc.edu>
10 ;; Keywords: emulations 10 ;; Keywords: emulations
11 11
12 ;;; Commentary: 12 ;;; Commentary:
13 13
14 ; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring) 14 ;; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
15 ; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu) 15 ;; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
16 ; Last revision: 01/07/87 Wed (for GNU Emacs 18.33) 16 ;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
17 17
18 ; INSTALLATION PROCEDURE: 18 ;; INSTALLATION PROCEDURE:
19 ; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of 19 ;; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
20 ; the single ESC used in real "vi", so I can access other ESC prefixed emacs 20 ;; the single ESC used in real "vi", so I can access other ESC prefixed emacs
21 ; commands while I'm in "vi"), say, by putting the following line in your 21 ;; commands while I'm in "vi"), say, by putting the following line in your
22 ; ".emacs" file: 22 ;; ".emacs" file:
23 ; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode 23 ;; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode
24 ; 2) If you wish you can define "find-file-hooks" to enter "vi" automatically 24 ;; 2) If you wish you can define "find-file-hook" to enter "vi" automatically
25 ; after a file is loaded into the buffer. For example, I defined it as: 25 ;; after a file is loaded into the buffer. For example, I defined it as:
26 ; (setq find-file-hooks (list 26 ;; (setq find-file-hook (list
27 ; (function (lambda () 27 ;; (function (lambda ()
28 ; (if (not (or (eq major-mode 'Info-mode) 28 ;; (if (not (or (eq major-mode 'Info-mode)
29 ; (eq major-mode 'vi-mode))) 29 ;; (eq major-mode 'vi-mode)))
30 ; (vi-mode)))))) 30 ;; (vi-mode))))))
31 ; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" 31 ;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
32 ; or you can execute the "load" command to load "vi" directly. 32 ;; or you can execute the "load" command to load "vi" directly.
33 ; 4) Read the comments for command "vi-mode" before you start using it. 33 ;; 4) Read the comments for command "vi-mode" before you start using it.
34 ; 34
35 ; COULD DO 35 ;; COULD DO
36 ; 1). A general 'define-operator' function to replace current hack 36 ;; 1). A general 'define-operator' function to replace current hack
37 ; 2). In operator handling, should allow other point moving Emacs commands 37 ;; 2). In operator handling, should allow other point moving Emacs commands
38 ; (such as ESC <, ESC >) to be used as arguments. 38 ;; (such as ESC <, ESC >) to be used as arguments.
39 ; 39
40 ;;; Code: 40 ;;; Code:
41 41
42 (defvar vi-mode-old-major-mode) 42 (defvar vi-mode-old-major-mode)
43 (defvar vi-mode-old-mode-name) 43 (defvar vi-mode-old-mode-name)
44 (defvar vi-mode-old-local-map) 44 (defvar vi-mode-old-local-map)
1485 (if flag (forward-char 1))))) arg) 1485 (if flag (forward-char 1))))) arg)
1486 t)) 1486 t))
1487 1487
1488 (provide 'vi) 1488 (provide 'vi)
1489 1489
1490 ;;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3 1490 ;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
1491 ;;; vi.el ends here 1491 ;;; vi.el ends here