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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
return {
"saghen/blink.cmp",
-- optional: provides snippets for the snippet source
dependencies = {
"rafamadriz/friendly-snippets",
{ "L3MON4D3/LuaSnip", version = "v1.*" },
"windwp/nvim-autopairs",
-- {
-- "zbirenbaum/copilot.lua",
-- cmd = { "Copilot" },
-- event = { "VeryLazy" },
-- opts = { suggestion = { enabled = false }, panel = { enabled = false } },
-- },
-- -- Add blink.cmp copilot source
-- {
-- "giuxtaposition/blink-cmp-copilot",
-- },
-- Add blink.cmp latex source for LaTeX/VimTeX support
"erooke/blink-cmp-latex",
-- Add minuet-ai for AI completions with llama-server
{
"milanglacier/minuet-ai.nvim",
config = function()
require('minuet').setup {
provider = 'openai_fim_compatible',
n_completions = 1, -- recommend for local model for resource saving
-- I recommend beginning with a small context window size and incrementally
-- expanding it, depending on your local computing power. A context window
-- of 512, serves as an good starting point to estimate your computing
-- power. Once you have a reliable estimate of your local computing power,
-- you should adjust the context window to a larger value.
context_window = 512,
provider_options = {
openai_fim_compatible = {
-- For Windows users, TERM may not be present in environment variables.
-- Consider using APPDATA instead.
api_key = 'TERM',
name = 'Qwen',
end_point = 'http://localhost:8012/v1/completions',
-- The model is set by the llama-cpp server and cannot be altered
-- post-launch.
model = 'PLACEHOLDER',
optional = {
max_tokens = 56,
top_p = 0.9,
},
-- Llama.cpp does not support the `suffix` option in FIM completion.
-- Therefore, we must disable it and manually populate the special
-- tokens required for FIM completion.
template = {
prompt = function(context_before_cursor, context_after_cursor, _)
return '<|fim_prefix|>'
.. context_before_cursor
.. '<|fim_suffix|>'
.. context_after_cursor
.. '<|fim_middle|>'
end,
suffix = false,
},
},
},
}
end,
},
},
-- use a release tag to download pre-built binaries
version = "1.*",
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
event = "VeryLazy",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- Opciones de keymap disponibles:
-- 'default' (actual) - Ctrl+y para aceptar, similar a built-in completions
-- 'super-tab' - Tab para aceptar, similar a VSCode
-- 'enter' - Enter para aceptar
-- 'none' - Sin atajos automáticos (defines los tuyos)
keymap = {
preset = "default",
-- Deshabilitar navegación con flechas
["<Up>"] = {},
["<Down>"] = {},
},
-- Todas las configuraciones de preset 'default' incluyen:
-- Ctrl+space: Abrir menú o mostrar docs si ya está abierto
-- Ctrl+n/Ctrl+p: Seleccionar siguiente/anterior
-- Ctrl+e: Ocultar menú
-- Ctrl+k: Toggle signature help (si signature.enabled = true)
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
nerd_font_variant = "mono",
},
completion = {
documentation = {
auto_show = true,
auto_show_delay_ms = 500,
window = { border = "rounded" },
},
menu = {
border = "rounded",
draw = {
columns = {
{ "label", "label_description", gap = 1 },
{ "kind_icon", "kind" },
},
},
},
ghost_text = { enabled = false },
},
-- Default list of enabled providers
sources = {
default = { "lsp", "path", "snippets", "buffer", "minuet" },
-- default = { "lsp", "path", "snippets", "buffer", "copilot", "minuet" },
per_filetype = {
tex = { "lsp", "path", "snippets", "buffer", "latex" },
bib = { "lsp", "path", "snippets", "buffer", "latex" },
codecompanion = { "codecompanion" },
},
providers = {
minuet = {
name = "minuet",
module = "minuet.blink",
score_offset = 101,
async = true,
},
-- copilot = {
-- name = "copilot",
-- module = "blink-cmp-copilot",
-- score_offset = 100,
-- async = true,
-- },
latex = {
name = "latex",
module = "blink-cmp-latex",
},
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
-- make lazydev completions top priority (see `:h blink.cmp`)
score_offset = 100,
},
},
},
snippets = { preset = "luasnip" },
-- Experimental signature help support
signature = { enabled = true },
cmdline = {
enabled = true,
keymap = {
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<C-e>"] = { "cancel", "fallback" },
},
completion = {
list = { selection = { preselect = false, auto_insert = false } },
menu = { auto_show = true },
},
sources = function()
local type = vim.fn.getcmdtype()
if type == "/" or type == "?" then return { "buffer" } end
if type == ":" or type == "@" then return { "cmdline" } end
return {}
end,
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
}
|