keymapsOnEvents

Register keymaps on an event instead of when nvim opens. Keys are the events to register on, and values are lists of keymaps to register on each event.

Type: attribute set of list of (submodule)

Default: { }

Example:

{
  InsertEnter = [
    {
      action = {
        __raw = "require(\"cmp\").mapping.confirm()";
      };
      key = "<C-y>";
    }
    {
      action = {
        __raw = "require(\"cmp\").mapping.select_next_item()";
      };
      key = "<C-n>";
    }
  ];
}

Declared by:

keymapsOnEvents.<name>.*.action

The action to execute.

Type: string or raw lua code

Declared by:

keymapsOnEvents.<name>.*.key

The key to map.

Type: string

Example: "<C-m>"

Declared by:

keymapsOnEvents.<name>.*.mode

One or several modes. Use the short-names ("n", "v", …). See :h map-modes to learn more.

Type: one of “c”, “i”, “!”, “l”, “n”, “”, “o”, “s”, “t”, “v”, “x” or list of (one of “c”, “i”, “!”, “l”, “n”, “”, “o”, “s”, “t”, “v”, “x”)

Default: ""

Example:

[
  "n"
  "v"
]

Declared by: