return{{"\098\108\105\110\107\046\099\109\112",event="\068\101\102\101\114\114\101\100\085\073\069\110\116\101\114",after=function()local O,V=pcall(require,"\109\105\110\105\046\105\099\111\110\115")if not O then vim.notify("\099\111\117\108\100 \110\111\116 \102\105\110\100 \096\109\105\110\105\046\105\099\111\110\115\096 \109\111\100\117\108\101",vim.log.leves.WARN)end local G={["\060\099-\115\112\097\099\101\062"]={"\115\104\111\119","\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"};["\060\067-\101\062"]={"\104\105\100\101"},["\060\067\082\062"]={"\097\099\099\101\112\116","\102\097\108\108\098\097\099\107"};["\060\116\097\098\062"]={"\115\101\108\101\099\116\095\110\101\120\116","\115\110\105\112\112\101\116\095\102\111\114\119\097\114\100","\102\097\108\108\098\097\099\107"};["\060\115-\116\097\098\062"]={"\115\101\108\101\099\116\095\112\114\101\118";"\115\110\105\112\112\101\116\095\098\097\099\107\119\097\114\100";"\102\097\108\108\098\097\099\107"};["\060\100\111\119\110\062"]={"\115\101\108\101\099\116\095\110\101\120\116","\102\097\108\108\098\097\099\107"},["\060\117\112\062"]={"\115\101\108\101\099\116\095\112\114\101\118","\102\097\108\108\098\097\099\107"};["\060\099-\098\062"]={"\115\099\114\111\108\108\095\100\111\099\117\109\101\110\116\097\116\105\111\110\095\117\112","\102\097\108\108\098\097\099\107"},["\060\099-\102\062"]={"\115\099\114\111\108\108\095\100\111\099\117\109\101\110\116\097\116\105\111\110\095\100\111\119\110";"\102\097\108\108\098\097\099\107"}}local L,U=pcall((require("\098\108\105\110\107\046\099\109\112")).setup,{cmdline={enabled=true,completion={menu={auto_show=true};list={selection={preselect=false}}},keymap=G,sources=function()local O=vim.fn.getcmdtype()if O=="\047"or O=="\063"then return{"\098\117\102\102\101\114";"\108\115\112"}end if O=="\058"then return{"\099\109\100\108\105\110\101";"\112\097\116\104"}end return{}end},keymap=G;appearance={kind_icons={Class=V.get("\108\115\112","\099\108\097\115\115");Color=V.get("\108\115\112","\099\111\108\111\114");Constant=V.get("\108\115\112","\099\111\110\115\116\097\110\116");Constructor=V.get("\108\115\112","\099\111\110\115\116\114\117\099\116\111\114");Enum=V.get("\108\115\112","\101\110\117\109");EnumMember=V.get("\108\115\112","\101\110\117\109\109\101\109\098\101\114"),Event=V.get("\108\115\112","\101\118\101\110\116");Field=V.get("\108\115\112","\102\105\101\108\100");File=V.get("\108\115\112","\102\105\108\101"),Folder=V.get("\108\115\112","\102\111\108\100\101\114"),Function=V.get("\108\115\112","\102\117\110\099\116\105\111\110"),Interface=V.get("\108\115\112","\105\110\116\101\114\102\097\099\101");Keyword=V.get("\108\115\112","\107\101\121\119\111\114\100"),Method=V.get("\108\115\112","\109\101\116\104\111\100");Module=V.get("\108\115\112","\109\111\100\117\108\101"),Operator=V.get("\108\115\112","\111\112\101\114\097\116\111\114"),Property=V.get("\108\115\112","\112\114\111\112\101\114\116\121");Reference=V.get("\108\115\112","\114\101\102\101\114\101\110\099\101");Snippet=V.get("\108\115\112","\115\110\105\112\112\101\116"),Struct=V.get("\108\115\112","\115\116\114\117\099\116"),Text=V.get("\108\115\112","\116\101\120\116"),TypeParameter=V.get("\108\115\112","\116\121\112\101\112\097\114\097\109\101\116\101\114");Unit=V.get("\108\115\112","\117\110\105\116");Value=V.get("\108\115\112","\118\097\108\117\101");Variable=V.get("\108\115\112","\118\097\114\105\097\098\108\101")}},completion={trigger={show_on_keyword=true},list={cycle={from_top=false;from_bottom=false}};menu={min_width=vim.o.pumwidth,max_height=vim.o.pumheight,scrolloff=0,draw={padding=1,gap=1,treesitter={"\098\117\102\102\101\114";"\108\115\112"},columns={{"\107\105\110\100\095\105\099\111\110"},{"\108\097\098\101\108";"\108\097\098\101\108\095\100\101\115\099\114\105\112\116\105\111\110";gap=1};{"\115\111\117\114\099\101\095\110\097\109\101"}},components={source_name={width={max=30},text=function(O)return string.format("\040\037\115\041",O.source_name)end,highlight="\066\108\105\110\107\067\109\112\083\111\117\114\099\101"},kind_icon={text=function(O)local V,G,L=(require("\109\105\110\105\046\105\099\111\110\115")).get("\108\115\112",O.kind)if O.kind=="\067\111\108\111\114"then V="\243\177\147\187"end return V..O.icon_gap end;highlight=function(O)local V,G,L=(require("\109\105\110\105\046\105\099\111\110\115")).get("\108\115\112",O.kind)return G end};kind={highlight=function(O)local V,G,L=(require("\109\105\110\105\046\105\099\111\110\115")).get("\108\115\112",O.kind)return G end}}}},ghost_text={enabled=true}},sources={default={"\108\115\112","\112\097\116\104","\115\110\105\112\112\101\116\115","\098\117\102\102\101\114"};transform_items=function(O,V)return((vim.iter(ipairs(V))):map(function(O,V)if V.kind==(require("\098\108\105\110\107\046\099\109\112\046\116\121\112\101\115")).CompletionItemKind.Snippet then V.score_offset=V.score_offset+1 end return V end)):totable()end,min_keyword_length=function()local O=1 return vim.bo.filetype=="\109\097\114\107\100\111\119\110"and 2 or O end};signature={enabled=true};fuzzy={max_typos=function(O)return 0 end;use_frecency=false;use_proximity=true;prebuilt_binaries={download=false}}})if not L then vim.notify("\101\114\114\111\114 \099\111\110\102\105\103\117\114\105\110\103 \098\108\105\110\107\046\099\109\112\058\n\t"..U,vim.log.levels.ERROR)return end end}}
return {
  {
    "blink.cmp",
    event = "DeferredUIEnter",
    after = function()
      local ok, icons = pcall(require, 'mini.icons')
      if not ok then
        vim.notify('could not find `mini.icons` module', vim.log.leves.WARN)
      end

      local keymap = {
        ["<c-space>"] = { "show", "show_documentation", "hide_documentation" },
        ['<C-e>'] = { 'hide' },
        ['<CR>'] = { 'accept', 'fallback' },

        ["<tab>"] = {
          "select_next",
          "snippet_forward",
          "fallback",
        },
        ["<s-tab>"] = { "select_prev", "snippet_backward", "fallback" },
        ["<down>"] = { "select_next", "fallback" },
        ["<up>"] = { "select_prev", "fallback" },

        ['<c-b>'] = { 'scroll_documentation_up', 'fallback' },
        ['<c-f>'] = { 'scroll_documentation_down', 'fallback' },
      }

      local ok, result = pcall(require("blink.cmp").setup, {
        cmdline = {
          enabled = true,
          completion = {
            menu = {
              auto_show = true,
            },
            list = {
              selection = {
                preselect = false,
              },
            },
          },
          keymap = keymap,
          -- By default, we choose providers for the cmdline based on the current cmdtype
          -- You may disable cmdline completions by replacing this with an empty table
          sources = function()
            local type = vim.fn.getcmdtype()
            -- Search forward and backward
            if type == "/" or type == "?" then
              return { "buffer", "lsp" }
            end
            -- Commands
            if type == ":" then
              return { "cmdline", "path" }
            end
            return {}
          end,
        },
        -- 'default' for mappings similar to built-in completion
        -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
        -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
        -- see the "default configuration" section below for full documentation on how to define
        -- your own keymap.
        keymap = keymap,

        appearance = {
          kind_icons = {
            Class = icons.get('lsp', 'class'),
            Color = icons.get('lsp', 'color'),
            Constant = icons.get('lsp', 'constant'),
            Constructor = icons.get('lsp', 'constructor'),
            Enum = icons.get('lsp', 'enum'),
            EnumMember = icons.get('lsp', 'enummember'),
            Event = icons.get('lsp', 'event'),
            Field = icons.get('lsp', 'field'),
            File = icons.get('lsp', 'file'),
            Folder = icons.get('lsp', 'folder'),
            Function = icons.get('lsp', 'function'),
            Interface = icons.get('lsp', 'interface'),
            Keyword = icons.get('lsp', 'keyword'),
            Method = icons.get('lsp', 'method'),
            Module = icons.get('lsp', 'module'),
            Operator = icons.get('lsp', 'operator'),
            Property = icons.get('lsp', 'property'),
            Reference = icons.get('lsp', 'reference'),
            Snippet = icons.get('lsp', 'snippet'),
            Struct = icons.get('lsp', 'struct'),
            Text = icons.get('lsp', 'text'),
            TypeParameter = icons.get('lsp', 'typeparameter'),
            Unit = icons.get('lsp', 'unit'),
            Value = icons.get('lsp', 'value'),
            Variable = icons.get('lsp', 'variable'),
          },
        },

        completion = {
          trigger = {
            show_on_keyword = true,
          },

          list = {
            cycle = {
              from_top = false,
              from_bottom = false,
            },
          },

          menu = {
            min_width = vim.o.pumwidth,
            max_height = vim.o.pumheight,
            scrolloff = 0,

            draw = {
              -- align_to = "label", -- or 'none' to disable, or 'cursor' to align to the cursor
              padding = 1,
              gap = 1,
              treesitter = { "buffer", "lsp" },
              columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { "source_name" } },
              components = {
                source_name = {
                  width = { max = 30 },
                  text = function(ctx)
                    return string.format("(%s)", ctx.source_name)
                  end,
                  highlight = "BlinkCmpSource",
                },
                kind_icon = {
                  text = function(ctx)
                    local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
                    if ctx.kind == "Color" then
                      kind_icon = "󱓻"
                    end
                    return kind_icon .. ctx.icon_gap
                  end,
                  highlight = function(ctx)
                    local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
                    return hl
                  end,
                },
                kind = {
                  highlight = function(ctx)
                    local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
                    return hl
                  end,
                }
              },
            },
          },

          ghost_text = {
            enabled = true,
          },
        },

        -- default list of enabled providers defined so that you can extend it
        -- elsewhere in your config, without redefining it, due to `opts_extend`
        sources = {
          default = { "lsp", "path", "snippets", "buffer" },

          transform_items = function(_, items)
            return vim
              .iter(ipairs(items))
              :map(function(_, item)
                if item.kind == require("blink.cmp.types").CompletionItemKind.Snippet then
                  item.score_offset = item.score_offset + 1
                end
                return item
              end)
              :totable()
          end,
          min_keyword_length = function()
            local default = 1
            return vim.bo.filetype == "markdown" and 2 or default
          end,
        },

        -- experimental signature help support
        signature = {
          enabled = true,
        },

        fuzzy = {
          max_typos = function(_)
            return 0
          end,
          -- frecency tracks the most recently/frequently used items and boosts the score of the item
          use_frecency = false,
          -- proximity bonus boosts the score of items matching nearby words
          use_proximity = true,

          prebuilt_binaries = {
            download = false,
          },
        },
      })
      if not ok then
        vim.notify("error configuring blink.cmp:\n\t" .. result, vim.log.levels.ERROR)
        return
      end
    end,
  },
}
