2017-11-02 05:03:24 +03:00
|
|
|
= Mapping
|
2017-03-07 17:39:40 +03:00
|
|
|
|
2017-11-02 05:03:24 +03:00
|
|
|
== Description
|
2017-03-07 17:39:40 +03:00
|
|
|
|
|
|
|
Creating and removing shortcuts boils down to the following commands,
|
|
|
|
respectively:
|
|
|
|
|
|
|
|
---------------------------------------
|
|
|
|
map [flags] <scope> <mode> <key> <keys>
|
|
|
|
unmap <scope> <mode> <key> [<expected>]
|
|
|
|
---------------------------------------
|
|
|
|
|
|
|
|
The *map* command makes *key* behave as if the *keys* sequence was typed.
|
|
|
|
|
|
|
|
*mode* dictates in what context the mapping will be available:
|
|
|
|
|
2017-11-02 12:37:39 +03:00
|
|
|
*insert*::
|
|
|
|
insert mode
|
|
|
|
*normal*::
|
|
|
|
normal mode
|
|
|
|
*prompt*::
|
|
|
|
prompts, such as when entering a command through *:*, or a regex through */*
|
|
|
|
*menu*::
|
|
|
|
mode entered when a menu is displayed with the 'menu' command
|
|
|
|
*user*::
|
|
|
|
mode entered when the user prefix is hit (default: ',')
|
|
|
|
*goto*::
|
|
|
|
mode entered when the goto key is hit (default: 'g')
|
|
|
|
*view*::
|
|
|
|
mode entered when the view key is hit (default: 'v')
|
|
|
|
*object*::
|
|
|
|
mode entered when an object selection is triggered (e.g. '<a-i>')
|
2017-03-07 17:39:40 +03:00
|
|
|
|
|
|
|
The context of execution of the above modes is always the current one at the
|
|
|
|
time of execution of the mapping, except for *user* mode (always executed
|
2018-02-23 16:31:28 +03:00
|
|
|
in a 'normal' context). Refer to <<modes#,`:doc modes`>> for more details.
|
2017-03-07 17:39:40 +03:00
|
|
|
|
|
|
|
An optional *-docstring* switch followed by a string can be used
|
|
|
|
to describe what the mapping does. This docstring will be used
|
|
|
|
in autoinfo boxes.
|
|
|
|
|
|
|
|
The *unmap* command removes a mapping of *key* in the given *scope* and
|
|
|
|
*mode*. If *expected* is specified, the mapping is removed only if it is
|
|
|
|
set to the same sequence of keys passed using the *expected* argument.
|
|
|
|
|
|
|
|
For more information about the values of the *scope* parameter, refer to
|
2017-11-06 12:08:59 +03:00
|
|
|
<<scopes#,`:doc scopes`>>.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
2017-11-02 05:03:24 +03:00
|
|
|
== Mappable keys
|
2017-09-18 05:59:41 +03:00
|
|
|
|
2018-02-23 16:31:28 +03:00
|
|
|
See <<keys#,`:doc keys`>> to discover the list of default bindings.
|
|
|
|
|
2017-09-18 05:59:41 +03:00
|
|
|
For *key* and *keys* in the *map* command, the following key names can
|
|
|
|
be used:
|
|
|
|
|
|
|
|
*x*, *<x>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
Most keys, especially alphabetic keys, represent themselves.
|
|
|
|
Keys can also be wrapped in angle-brackets for consistency
|
|
|
|
with the non-alphabetic keys below.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*X*, *<X>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
Holding down Shift while pressing the *x* key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<c-x>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
Holding down Control while pressing the *x* key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<a-x>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
Holding down Alt while pressing the *x* key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
2017-11-06 12:08:59 +03:00
|
|
|
*<c-a-x>*::
|
|
|
|
Holding down Control and Alt while pressing the *x* key.
|
|
|
|
|
2017-09-18 05:59:41 +03:00
|
|
|
*<lt>*, *<gt>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The *<* and *>* characters.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<plus>*, *<minus>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The *+* and *-* characters..
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<ret>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The Return or Enter key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<space>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The space bar.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<tab>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The Tab key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<backtab>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The reverse-tab key. This is Shift-Tab on most keyboards.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<backspace>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The Backspace (delete to the left) key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<del>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The Delete (to the right) key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<esc>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The Escape key.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
2017-11-06 12:08:59 +03:00
|
|
|
*<up>*, *<down>*, *<left>*, *<right>*::
|
|
|
|
*<pageup>*, *<pagedown>*, *<home>*, *<end>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
The usual cursor-movement keys.
|
2017-09-18 05:59:41 +03:00
|
|
|
|
|
|
|
*<f1>*, *<f2>*, ...*<f12>*::
|
2017-11-02 12:37:39 +03:00
|
|
|
Function keys.
|