Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

plugins.lsp.keymaps.extra

Extra keymaps to register when an LSP is attached. This can be used to customise LSP behaviour, for example with “telescope” or the “Lspsaga” plugin, as seen in the examples.

Type: list of (submodule)

Default: [ ]

Example:

[
  {
    action = "<CMD>LspStop<Enter>";
    key = "<leader>lx";
  }
  {
    action = "<CMD>LspStart<Enter>";
    key = "<leader>ls";
  }
  {
    action = "<CMD>LspRestart<Enter>";
    key = "<leader>lr";
  }
  {
    action = {
      __raw = "require('telescope.builtin').lsp_definitions";
    };
    key = "gd";
  }
  {
    action = "<CMD>Lspsaga hover_doc<Enter>";
    key = "K";
  }
]

Declared by:

plugins.lsp.keymaps.extra.*.action

The action to execute.

Type: string or raw lua code

Declared by:

plugins.lsp.keymaps.extra.*.key

The key to map.

Type: string

Example: "<C-m>"

Declared by:

plugins.lsp.keymaps.extra.*.mode

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

Type: one of or non-empty list of “”, “n”, “!”, “i”, “c”, “v”, “x”, “s”, “o”, “t”, “l”, “!a”, “ia”, “ca”

Default: ""

Example:

[
  "n"
  "v"
]

Declared by: