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

lsp.servers.clangd

The clangd language server.

Type: submodule

Default: { }

Declared by:

lsp.servers.clangd.enable

Whether to enable clangd.

Type: boolean

Default: false

Example: true

Declared by:

lsp.servers.clangd.package

The clangd package to use.

Alternatively, clangd should be installed on your $PATH.

Type: null or package

Default: pkgs.clang-tools

Declared by:

lsp.servers.clangd.packageFallback

When enabled, the language server package will be added to the end of the PATH (suffix) instead of the beginning (prefix).

This can be useful if you want local versions of the language server (e.g. from a devshell) to override the nixvim version.

Type: boolean

Default: false

Declared by:

lsp.servers.clangd.activate

Whether to call vim.lsp.enable() for clangd.

Type: boolean

Default: true, unless the server’s name is *

Example: false

Declared by:

lsp.servers.clangd.config

Configurations for clangd.

Type: attribute set of anything

Default: { }

Example:

{
  cmd = [
    "clangd"
    "--background-index"
  ];
  filetypes = [
    "c"
    "cpp"
  ];
  root_markers = [
    "compile_commands.json"
    "compile_flags.txt"
  ];
}

Declared by:

lsp.servers.clangd.name

The name to use for clangd. Supplied to functions like vim.lsp.enable().

Type: string or raw lua code

Default: "clangd"

Declared by: