Remove lazy in favour of mini.deps

This commit is contained in:
2026-01-27 22:48:54 +01:00
parent 281589bf18
commit b7d4836f9f
14 changed files with 339 additions and 419 deletions

View File

@@ -1,69 +1,70 @@
---@module 'lazy'
---@type LazySpec
return { {
'saghen/blink.cmp',
event = 'InsertEnter',
version = '*',
build = 'cargo build --release',
dependencies = {
'saghen/blink.compat',
local function build_blink(params)
vim.notify('Building blink.cmp', vim.log.levels.INFO)
local obj = vim.system({ 'cargo', 'build', '--release' }, { cwd = params.path }):wait()
if obj.code == 0 then
vim.notify('Building blink.cmp done', vim.log.levels.INFO)
else
vim.notify('Building blink.cmp failed', vim.log.levels.ERROR)
end
end
MiniDeps.add({
source = 'https://github.com/saghen/blink.cmp',
hooks = {
post_install = build_blink,
post_checkout = build_blink,
},
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = 'none',
['<tab>'] = { 'accept', 'fallback' }, -- accept the snippet
['<c-space>'] = { 'show', 'show_documentation', 'hide_documentation' }, -- toggle auto-cmp manually
['<c-k>'] = { 'show_signature', 'hide_signature', 'fallback' }, -- toggle signature
['<c-n>'] = { 'select_next', 'fallback' }, -- next item
['<c-p>'] = { 'select_prev', 'fallback' }, -- previous item
['<c-f>'] = { 'scroll_documentation_down', 'fallback' }, -- forwards into the docs
['<c-b>'] = { 'scroll_documentation_up', 'fallback' }, -- backwards into the docs
['<c-e>'] = { 'cancel', 'fallback' }, -- keybind for cancelling completion
},
snippets = { preset = 'luasnip' },
sources = {
default = { 'lsp', 'path', 'snippets' },
},
completion = {
menu = {
auto_show = true, -- whether to automatically show the window when new completion items are available
border = 'rounded',
draw = {
columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { 'kind' } },
treesitter = { 'lsp', 'snippets' },
},
})
require('blink.cmp').setup({
keymap = {
preset = 'none',
['<tab>'] = { 'accept', 'fallback' }, -- accept the snippet
['<c-space>'] = { 'show', 'show_documentation', 'hide_documentation' }, -- toggle auto-cmp manually
['<c-k>'] = { 'show_signature', 'hide_signature', 'fallback' }, -- toggle signature
['<c-n>'] = { 'select_next', 'fallback' }, -- next item
['<c-p>'] = { 'select_prev', 'fallback' }, -- previous item
['<c-f>'] = { 'scroll_documentation_down', 'fallback' }, -- forwards into the docs
['<c-b>'] = { 'scroll_documentation_up', 'fallback' }, -- backwards into the docs
['<c-e>'] = { 'cancel', 'fallback' }, -- keybind for cancelling completion
},
snippets = { preset = 'luasnip' },
sources = {
default = { 'lsp', 'path', 'snippets' },
},
completion = {
menu = {
auto_show = true, -- whether to automatically show the window when new completion items are available
border = 'rounded',
draw = {
columns = { { "kind_icon" }, { "label", "label_description", gap = 1 }, { 'kind' } },
treesitter = { 'lsp', 'snippets' },
},
documentation = {
auto_show = true, -- whether documentation is automatically shown when selecting a completion item
auto_show_delay_ms = 250,
treesitter_highlighting = true,
window = { border = "rounded" },
},
list = { selection = { preselect = true, auto_insert = true } },
trigger = {
show_on_insert_on_trigger_character = true,
show_on_accept_on_trigger_character = true,
show_in_snippet = false,
},
ghost_text = {
enabled = true,
show_with_selection = false, -- whether the ghost text is shown when an item is selected
show_without_selection = true, -- whether the ghost text is shown when no item is selected
show_with_menu = true, -- show ghost text when the menu is open
show_without_menu = true, -- show ghost text when the menu is closed
}
},
fuzzy = {
use_proximity = true,
frecency = { enabled = true, },
prebuilt_binaries = {
download = false, -- we are building from source
}
documentation = {
auto_show = true, -- whether documentation is automatically shown when selecting a completion item
auto_show_delay_ms = 250,
treesitter_highlighting = true,
window = { border = "rounded" },
},
list = { selection = { preselect = true, auto_insert = true } },
trigger = {
show_on_insert_on_trigger_character = true,
show_on_accept_on_trigger_character = true,
show_in_snippet = false,
},
ghost_text = {
enabled = true,
show_with_selection = false, -- whether the ghost text is shown when an item is selected
show_without_selection = true, -- whether the ghost text is shown when no item is selected
show_with_menu = true, -- show ghost text when the menu is open
show_without_menu = true, -- show ghost text when the menu is closed
}
},
config = function(_, opts)
require("blink.cmp").setup(opts)
end
} }
fuzzy = {
use_proximity = true,
frecency = { enabled = true, },
prebuilt_binaries = {
download = true, -- we are building from source
}
}
})