1 |
;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs |
;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs |
2 |
|
|
3 |
; This file is in the public domain because the authors distributed it |
;; This file is in the public domain because the authors distributed it |
4 |
; without a copyright notice before the US signed the Bern Convention. |
;; without a copyright notice before the US signed the Bern Convention. |
5 |
|
|
6 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
7 |
|
|
11 |
|
|
12 |
;;; Commentary: |
;;; Commentary: |
13 |
|
|
14 |
; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring) |
;; 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) |
;; 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) |
;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33) |
17 |
|
|
18 |
; INSTALLATION PROCEDURE: |
;; INSTALLATION PROCEDURE: |
19 |
; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of |
;; 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 |
;; 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 |
;; commands while I'm in "vi"), say, by putting the following line in your |
22 |
; ".emacs" file: |
;; ".emacs" file: |
23 |
; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode |
;; (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 |
;; 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: |
;; after a file is loaded into the buffer. For example, I defined it as: |
26 |
; (setq find-file-hooks (list |
;; (setq find-file-hook (list |
27 |
; (function (lambda () |
;; (function (lambda () |
28 |
; (if (not (or (eq major-mode 'Info-mode) |
;; (if (not (or (eq major-mode 'Info-mode) |
29 |
; (eq major-mode 'vi-mode))) |
;; (eq major-mode 'vi-mode))) |
30 |
; (vi-mode)))))) |
;; (vi-mode)))))) |
31 |
; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" |
;; 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. |
;; 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. |
;; 4) Read the comments for command "vi-mode" before you start using it. |
34 |
; |
|
35 |
; COULD DO |
;; COULD DO |
36 |
; 1). A general 'define-operator' function to replace current hack |
;; 1). A general 'define-operator' function to replace current hack |
37 |
; 2). In operator handling, should allow other point moving Emacs commands |
;; 2). In operator handling, should allow other point moving Emacs commands |
38 |
; (such as ESC <, ESC >) to be used as arguments. |
;; (such as ESC <, ESC >) to be used as arguments. |
39 |
; |
|
40 |
;;; Code: |
;;; Code: |
41 |
|
|
42 |
(defvar vi-mode-old-major-mode) |
(defvar vi-mode-old-major-mode) |
1487 |
|
|
1488 |
(provide 'vi) |
(provide 'vi) |
1489 |
|
|
1490 |
;;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3 |
;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3 |
1491 |
;;; vi.el ends here |
;;; vi.el ends here |