VIP uses 2 main keymaps: vip-mode-map
for Vi mode commands, and
vip-insert-mode-map
for Insert mode commands. By default,
vip-insert-mode-map
makes non VI keys insert themselves.
VIP also suppresses Emacs control keys in vip-mode-map
.
To unsuppress emacs bindings in Vi and Insert modes, put the line
(vip-make-emacs-keys-visible)
in your `.vip' file. To unsuppress bindings in just Insert mode, put
(setq-default vip-insert-mode-vi-map nil)
in your `.vip' file. This unsuppresses Emacs bindings for all buffers. To do that selectively, you will have to
(setq vip-insert-mode-vi-map nil)
in just those buffers. This is usually accomplished in customization hooks for major modes. See section `Mode Hooks' in The GNU Emacs Manual, and See section `Hooks' in GNU Emacs Lisp Reference Manual, for details.
You can also alter the vip-insert-mode-map
to change the
bindings. Note that changing to a VI compatible insert mode also
requires undefining some bindings. This is done in the function
vip-insert-mode-bindings
. To make a substantial change, you have
to redefine this function. The vip-insert-mode-map
was defined
primararily so that :map! could be implemented.
That was about VIP bindings. For normal Emacs bindings, read the following. See section `Customization' in The GNU Emacs Manual, and the Emacs quick reference card for more info. To bind a function to a key, say C-s for incremental search
(define-key vip-mode-map "\C-s" 'isearch-forward)
To set a key globally,
(global-set-key "\C-s" 'isearch-forward)
Note that local mode maps override the global keymap.
Each Emacs command key calls some lisp function. If you have enabled the Help, (see section Rudimentary Changes) C-h k will show you the function.
:map and :map! defined Vi/Ex macros, and cannot be used to define bindings for Emacs functions. See section VI Macros, for details.