define_keymap
define_keymap [ -prefix] name
This command creates a new keymap named name that initially has no keys mapped. name has the same syntax as variables names: it must start with a letter and is composed of letters, digits, and underscores. The keymap name must not be one of the predefined maps such as system or user, a window class name such as edit, cmd, helpwin, etc., or a window name as returned by window_name (for example, window4, window7, window11).
Key and mouse bindings may be assigned to the keymap using the map command. The keymap may be attached to the current window by using the command set keymap=name.
If -prefix is specified, then the keymap is created as a prefix keymap. A prefix keymap differs from a normal keymap in that it is attached to a window by a key press (termed a prefix key) and remains attached to the window only for the next key or button press. This allows a command or command list to be mapped to a sequence of key presses. For example, the key sequence CTRL+X, CTRL+S is mapped to the save command in the example that follows.
dkm is a synonym for define_keymap.
Examples
define_keymap -prefix ctrl_x_map
map @ctrl_x_map control-s save
define_keymap emacs
map @emacs control-x set keymap=ctrl_x_map
Related Topics