aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/nvim/lua/plugins/completion.lua
blob: df24a5dbe47ec5cae754980bd073467cfb2280d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
require("blink.compat").setup({})

require("blink.cmp").setup({
  keymap = {
    preset = "cmdline",
    ["<CR>"] = { "accept", "fallback" },
  },
  appearance = {
    use_nvim_cmp_as_default = true,
  },
  completion = {
    menu = {
      draw = {
        columns = { { "kind_icon" }, { "label", gap = 1 } },
        components = {
          label = {
            text = function(ctx)
              return require("colorful-menu").blink_components_text(ctx)
            end,
            highlight = function(ctx)
              return require("colorful-menu").blink_components_highlight(ctx)
            end,
          },
        },
      },
    },
    list = {
      selection = {
        preselect = function()
          return not require("blink.cmp").snippet_active({ direction = 1 })
        end,
      },
    },
    documentation = { auto_show = true },
  },
  signature = {
    enabled = true,
    trigger = {
      enabled = true,
      show_on_keyword = true,
      show_on_insert = true,
    },
  },
  sources = {
    default = { "lazydev", "lsp", "copilot", "snippets", "path", "buffer" },
    per_filetype = {
      ["dap-repl"] = { "dap" },
    },
    providers = {
      path = {
        opts = {
          get_cwd = vim.fn.getcwd,
        },
      },
      copilot = {
        name = "copilot",
        module = "blink-copilot",
        score_offset = 100,
        async = true,
      },
      lazydev = {
        name = "LazyDev",
        module = "lazydev.integrations.blink",
        score_offset = 100,
      },
      dap = { name = "dap", module = "blink.compat.source" },
    },
  },
})

require("blink.pairs").setup({
  mappings = {
    disabled_filetypes = {},
  },
  highlights = {
    groups = {
      "BlinkIndentOrange",
      "BlinkIndentViolet",
      "BlinkIndentBlue",
      "BlinkIndentRed",
      "BlinkIndentCyan",
      "BlinkIndentYellow",
      "BlinkIndentGreen",
    },
  },
})