Options provided to the require('blink-cmp').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  appearance = {
    nerd_font_variant = "normal";
    use_nvim_cmp_as_default = true;
  };
  completion = {
    accept = {
      auto_brackets = {
        enabled = true;
        semantic_token_resolution = {
          enabled = false;
        };
      };
    };
    documentation = {
      auto_show = true;
    };
  };
  keymap = {
    preset = "super-tab";
  };
  signature = {
    enabled = true;
  };
  sources = {
    cmdline = [ ];
    providers = {
      buffer = {
        score_offset = -7;
      };
      lsp = {
        fallbacks = [ ];
      };
    };
  };
}

Declared by:

A function that returns whether blink-cmp should be enabled or not for this buffer.

Type: null or raw lua code

Default: null

Plugin default: lib.nixvim.mkRaw "function()\n return vim.bo.buftype ~= 'prompt' and vim.b.completion ~= false\nend\n"

Example: lib.nixvim.mkRaw "function()\n return not vim.tbl_contains({ \"lua\", \"markdown\" }, vim.bo.filetype)\n and vim.bo.buftype ~= \"prompt\"\n and vim.b.completion ~= false\nend\n"

Declared by:

The keymap can be:

  • A preset ('default' | 'super-tab' | 'enter')
  • A table of keys => command[] (optionally with a “preset” key to merge with a preset) When specifying ‘preset’ in the keymap table, the custom key mappings are merged with the preset, and any conflicting keys will overwrite the preset mappings.

Type: null or (attribute set of anything) or value false (singular enum) or raw lua code

Default: null

Plugin default:

{
  preset = "default";
}

Example:

{
  "<C-b>" = [
    "scroll_documentation_up"
    "fallback"
  ];
  "<C-e>" = [
    "hide"
  ];
  "<C-f>" = [
    "scroll_documentation_down"
    "fallback"
  ];
  "<C-n>" = [
    "select_next"
    "fallback"
  ];
  "<C-p>" = [
    "select_prev"
    "fallback"
  ];
  "<C-space>" = [
    "show"
    "show_documentation"
    "hide_documentation"
  ];
  "<C-y>" = [
    "select_and_accept"
  ];
  "<Down>" = [
    "select_next"
    "fallback"
  ];
  "<S-Tab>" = [
    "snippet_backward"
    "fallback"
  ];
  "<Tab>" = [
    "snippet_forward"
    "fallback"
  ];
  "<Up>" = [
    "select_prev"
    "fallback"
  ];
}

Declared by: