return{"\083\097\103\104\101\110\047\098\108\105\110\107\046\099\109\112",version="\042",event="\070\105\108\101\084\121\112\101",opts={enabled=function()return not vim.b.copilot_suggestion_auto_trigger end;keymap={preset="\110\111\110\101";["\060\067-\097\062"]={"\115\101\108\101\099\116\095\097\110\100\095\097\099\099\101\112\116"};["\060\067-\110\062"]={"\115\101\108\101\099\116\095\110\101\120\116";"\102\097\108\108\098\097\099\107"};["\060\067-\112\062"]={"\115\101\108\101\099\116\095\112\114\101\118","\102\097\108\108\098\097\099\107"},["\060\067-\100\062"]={"\115\104\111\119\095\100\111\099\117\109\101\110\116\097\116\105\111\110","\104\105\100\101\095\100\111\099\117\109\101\110\116\097\116\105\111\110";"\102\097\108\108\098\097\099\107"}};completion={keyword={range="\112\114\101\102\105\120"},trigger={show_on_keyword=true},documentation={auto_show=true;auto_show_delay_ms=1000},list={selection={preselect=true;auto_insert=true}},accept={auto_brackets={enabled=false}};menu={auto_show=function(W)if W.mode=="\099\109\100\108\105\110\101"or vim.bo.buftype=="\112\114\111\109\112\116"then return false end return not vim.tbl_contains({"\047";"\063"},vim.fn.getcmdtype())end,draw={treesitter={"\108\115\112"}}}},fuzzy={implementation="\114\117\115\116"},signature={enabled=true},appearance={use_nvim_cmp_as_default=true,nerd_font_variant="\109\111\110\111"};sources={default={"\108\115\112";"\112\097\116\104";"\098\117\102\102\101\114"};per_filetype={codecompanion={"\099\111\100\101\099\111\109\112\097\110\105\111\110"}}}}}
-- autocompletion
-- https://github.com/Saghen/blink.cmp

return {
  "Saghen/blink.cmp",
  version = "*",
  event = "FileType",

  opts = {
    enabled = function()
      return not vim.b.copilot_suggestion_auto_trigger
    end,

    keymap = {
      preset = "none",

      ["<C-a>"] = {
        "select_and_accept",
      },
      ["<C-n>"] = {
        "select_next",
        "fallback",
      },
      ["<C-p>"] = {
        "select_prev",
        "fallback",
      },
      ["<C-d>"] = {
        "show_documentation",
        "hide_documentation",
        "fallback",
      },
    },

    completion = {
      keyword = {
        range = "prefix",
      },
      trigger = {
        show_on_keyword = true,
      },
      documentation = {
        auto_show = true,
        auto_show_delay_ms = 1000,
      },
      list = {
        selection = {
          preselect = true,
          auto_insert = true,
        },
      },
      accept = {
        auto_brackets = {
          enabled = false,
        },
      },
      menu = {
        auto_show = function(ctx)
          if ctx.mode == "cmdline" or vim.bo.buftype == "prompt" then
            return false
          end
          return not vim.tbl_contains({ "/", "?" }, vim.fn.getcmdtype())
        end,
        draw = {
          treesitter = { "lsp" },
        },
      },
    },

    fuzzy = {
      implementation = "rust",
    },

    signature = {
      enabled = true,
    },

    appearance = {
      use_nvim_cmp_as_default = true,
      nerd_font_variant = "mono",
    },

    sources = {
      default = { "lsp", "path", "buffer" },
      per_filetype = {
        codecompanion = { "codecompanion" },
      },
    },
  },
}
