lsp.completion.enable

Whether to enable completion support. Uses nvim-cmp under the hood.

Type: boolean

Default: false

Example: true

Declared by:

lsp.completion.opts

Additional options to pass to cmp.setup(). Note that for simple setups (ex: keybindings and sources), you do not need to pass anything to this option and should instead use the keys and sources options respectively (in fact, default keymaps are already set, although they may be overwritten using this option).

The nvim-cmp module is made available in this scope under the variable name cmp.

Type: attribute set

Default: { }

Example:

window = {
  completion = rawLua "cmp.config.window.bordered()";
  documentation = rawLua "cmp.config.window.bordered()";
};

Declared by:

lsp.completion.sources

Extra cmp sources to make available during cmp.setup().

Type: attribute set of (submodule)

Default: { }

Declared by:

lsp.completion.sources.<name>.name

The name of the completion source module. If not set, the attribute’s name is used.

Type: null or string

Default: null

Declared by:

lsp.completion.sources.<name>.opts

Options to use for this completion source. Consult the nvim-cmp documentation for available options.

Type: attribute set

Default: { }

Example:

{
  keyword_length = 5;
}

Declared by:

lsp.completion.sources.<name>.src

The source of the completion module.

Type: package

Declared by:

lsp.completion.src

Source to use for this plugin (note this source refers to the nvim-cmp package to use, although you could swap this out for whatever you like (at the cost of functionality).

Type: package

Default: <derivation source>

Declared by:

lsp.lsp-config.enable

Whether to enable lsp-config.

Type: boolean

Default: false

Example: true

Declared by:

lsp.lsp-config.capabilities

A stringified lua table which is inserted into each language server’s setup function as the capabilities parameter.

Type: string

Default: "vim.lsp.protocol.make_client_capabilities()"

Declared by:

lsp.lsp-config.onAttach

A stringified lua function which is inserted into each language server’s setup function as the on_attach parameter.

Type: string

Default:

''
  function(_, bufnr)
    local opts = { silent = true, buffer = bufnr }
    vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
    vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
    vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
    vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
    vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
    vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
    vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
    vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
    vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
    vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
    vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
    vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
    vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, opts)
  end
''

Declared by:

lsp.lsp-config.servers

A map of server names to their configuration. The configuration is passed to the setup function of the server.

Type: attribute set of (submodule)

Default: { }

Declared by:

lsp.lsp-config.servers.<name>.cmd

The command used to start the language server. Each argv should be a separate list entry.

If you want to use the default lspconfig ‘cmd’ value, set this value to null (this is the default).

Type: null or (list of string)

Default: null

Example:

cmd = [ "${pkgs.myLanguageServer}/bin/my-lsp" "--stdio"];

Declared by:

lsp.lsp-config.servers.<name>.extraOpts

Additional options to pass to the lsp server setup in require('lspconfig')[<name>].setup(<opts>).

Refer to the LSPconfig server configuration documentation for all available options.

Type: attribute set

Default: { }

Declared by:

lsp.lsp-config.src

Source to use for this plugin (note this source refers to the nvim-lspconfig package to use, although you could swap this out for whatever you like (at the cost of functionality).

Type: package

Default: <derivation source>

Declared by:

lsp.snippets.enable

Whether to enable snippet support. Uses luasnip under the hood.

Type: boolean

Default: false

Example: true

Declared by:

lsp.snippets.keys

A list of keybindings to set up for Luasnip. Follows standard lazy keymap spec.

Type: list of (attribute set)

Default: [ ]

Declared by:

lsp.snippets.src

Source to use for this plugin (note this source refers to the luasnip package to use, although you could swap this out for whatever you like (at the cost of functionality).

Type: package

Default: <derivation vimplugin-luasnip-2023-07-26>

Declared by:

languages.lua.enable

Whether to enable lua LSP features / additional language tooling…

Type: boolean

Default: false

Example: true

Declared by:

languages.lua.lspPkg

Lua language server package to use

Type: package

Default: <derivation lua-language-server-3.6.25>

Declared by:

languages.lua.settings

server-configuration settings to pass to the lsp-config setup.

Type: attribute set

Default:

{
  Lua = {
    diagnostics = {
      globals = [
        "vim"
      ];
      unusedLocalExclude = [
        "_*"
      ];
    };
    semantic = {
      enable = false;
    };
    workspace = {
      library = [
        "/nix/store/bn7q02pqq0cjsj239dg1h7s2f3h818jc-rtp"
      ];
    };
  };
  single_file_support = true;
}

Declared by:

languages.nix.enable

Whether to enable nix LSP features / additional language tooling…

Type: boolean

Default: false

Example: true

Declared by:

languages.nix.settings

Additional options passed to nix-lsp.

Consult the project’s documentation for all available options.

Type: attribute set

Default: { }

Declared by:

languages.rust.enable

Whether to enable rust LSP features / additional language tooling…

Type: boolean

Default: false

Example: true

Declared by:

languages.rust.settings

Additional options passed to rust-lsp.

Consult the project’s documentation for all available options.

Type: attribute set

Default: { }

Declared by: