File: vi.el.html
This file is obsolete. Consider using viper instead.
Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring) Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu) Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
INSTALLATION PROCEDURE:
1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
the single ESC used in real "vi", so I can access other ESC prefixed emacs
commands while I'm in "vi"), say, by putting the following line in your
".emacs" file:
(define-key global-map "\\e\\e" 'vi-mode) ;quick switch into vi-mode
2) If you wish you can define "find-file-hook" to enter "vi" automatically
after a file is loaded into the buffer. For example, I defined it as:
(setq find-file-hook (list
(function (lambda ()
(if (not (or (eq major-mode 'Info-mode)
(eq major-mode 'vi-mode)))
(vi-mode))))))
3) In your init file you can define the command "vi-mode" to be "autoload"
or you can execute the "load" command to load "vi" directly.
4) Read the comments for command "vi-mode" before you start using it.
COULD DO
1). A general 'define-operator' function to replace current hack
2). In operator handling, should allow other point moving Emacs commands
(such as ESC <, ESC >) to be used as arguments.
Defined variables (18)
vi-com-map | Keymap used in Evi’s command state |
vi-ins-length | Length of last insertion. |
vi-ins-overwrt-p | T if last insertion was a replace actually. |
vi-ins-point | Last insertion point. Should use ‘mark’ instead. |
vi-ins-prefix-code | Code to be eval’ed before (redo-)insertion begins. |
vi-ins-repetition | The repetition required for last insertion. |
vi-insert-state | Non-nil if it is in insert state. |
vi-last-change-command | Save commands for redoing last changes. Each command is in (FUNC . ARGS) |
vi-last-find-char | Save last direction, char and upto-flag used for char finding. |
vi-last-shell-command | Save last shell command given for "!" operator. |
vi-mark-alist | Alist of (NAME . MARK), marks are local to each buffer. |
vi-mode-old-local-map | Save the local-map used before entering vi-mode. |
vi-mode-old-major-mode | Save the major-mode before entering vi-mode. |
vi-mode-old-mode-name | Save the mode-name before entering vi-mode. |
vi-scroll-amount | Default amount of lines for scrolling (used by "^D"/"^U"). |
vi-search-last-command | Save last search command for possible redo. |
vi-shift-width | Shift amount for "<"/">" operators. |
vi-tilde-map | Keymap used for C-x ~ prefix key. Link to various major modes. |