| www.delorie.com/gnu/docs/emacs/vip_5.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Loading VIP has the effect of globally binding C-z (Control-z)
to the function vip-change-mode-to-vi. The default binding of C-z
in GNU Emacs is suspend-emacs, but, you can also call
suspend-emacs by typing C-x C-z. Other than this, all the
key bindings of Emacs remain the same after loading VIP.
Now, if you hit C-z, the function vip-change-mode-to-vi will be
called and you will be in vi mode. (Some major modes may locally bind
C-z to some special functions. In such cases, you can call
vip-change-mode-to-vi by execute-extended-command which is
invoked by M-x. Here M-x means Meta-x, and if your
terminal does not have a META key you can enter it by typing
ESC x. The same effect can also be achieve by typing
M-x vip-mode.)
You can observe the change of mode by looking at the mode line. For instance, if the mode line is:
-----Emacs: *scratch* (Lisp Interaction)----All------------ |
-----Vi: *scratch* (Lisp Interaction)----All------------ |
You can go back to the original emacs mode by typing C-z in vi mode. Thus C-z toggles between these two modes.
Note that modes in VIP exist orthogonally to modes in Emacs. This means that you can be in vi mode and at the same time, say, shell mode.
Vi mode corresponds to Vi's command mode. From vi mode you can enter insert mode (which corresponds to Vi's insert mode) by usual Vi command keys like i, a, o ... etc.
In insert mode, the mode line will look like this:
-----Insert *scratch* (Lisp Interaction)----All------------ |
That VIP has three modes may seem very complicated, but in fact it is not so. VIP is implemented so that you can do most editing remaining only in the two modes for Vi (that is vi mode and insert mode).
The figure below shows the transition of three modes in VIP.
=== C-z ==> == i,o ... ==>
emacs mode vi mode insert mode
<== X-z === <=== ESC ====
|
1.3.1 Emacs Mode This is the mode you should know better. 1.3.2 Vi Mode Vi commands are executed in this mode. 1.3.3 Insert Mode You can enter text, and also can do editing if you know enough Emacs commands.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |