-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblink-cmp-config.lua
More file actions
98 lines (96 loc) · 2.86 KB
/
blink-cmp-config.lua
File metadata and controls
98 lines (96 loc) · 2.86 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
local M = {
'saghen/blink.cmp',
build = 'cargo build --release',
event = { 'InsertEnter', 'CmdlineEnter' },
dependencies = {
'rafamadriz/friendly-snippets',
{ 'fang2hou/blink-copilot', opts = { max_completions = 2, max_attemps = 3 } },
},
}
M.opts = {
keymap = {
['<Tab>'] = {
'snippet_forward',
function(cmp)
return cmp.select_next({ on_ghost_text = true })
end,
'fallback'
},
['<S-Tab>'] = {
'snippet_backward',
function(cmp)
return cmp.select_prev({ on_ghost_text = true })
end,
'fallback',
},
['<CR>'] = { 'accept', 'fallback' },
['<C-e>'] = { 'cancel', 'fallback' },
['<M-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
},
completion = {
list = {
max_items = 50,
selection = {
preselect = true,
auto_insert = function(ctx)
return ctx.mode == 'cmdline' and not vim.tbl_contains({ '/', '/?' }, vim.fn.getcmdtype())
end
}
},
menu = {
auto_show = false,
winblend = vim.opt.pumblend:get(),
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu',
scrollbar = false,
draw = {
gap = 2,
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
},
},
documentation = {
auto_show = true,
auto_show_delay_ms = 250,
window = {
winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,BlinkCmpDocSeparator:Pmenu',
}
},
ghost_text = {
enabled = true,
}
},
signature = {
enabled = false,
},
appearance = {
nerd_font_variant = 'mono'
},
cmdline = {
keymap = {
['<CR>'] = { 'accept_and_enter', 'fallback' },
['<C-e>'] = { 'hide', 'fallback' },
['<Tab>'] = { 'show_and_insert', 'select_next', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' },
},
completion = {
menu = { auto_show = false },
ghost_text = { enabled = false },
},
},
sources = {
default = { 'copilot', 'lsp', 'buffer', 'snippets', 'path' },
providers = {
buffer = {
opts = { enable_in_ex_commands = true }
},
copilot = {
name = 'copilot',
module = 'blink-copilot',
score_offset = 100,
async = true,
},
}
}
}
return M