1
0
Fork 0

cmp -> blink

This commit is contained in:
zymon 2025-03-28 21:14:51 +01:00
parent 0da3485644
commit dec72a02aa
2 changed files with 18 additions and 77 deletions

View file

@ -0,0 +1,18 @@
return {
"https://github.com/saghen/blink.cmp",
version = '1.*',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = { preset = 'default' },
appearance = {
nerd_font_variant = 'mono'
},
completion = { documentation = { auto_show = false } },
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
},
opts_extend = { "sources.default" }
}

View file

@ -1,77 +0,0 @@
return {
{
"https://github.com/hrsh7th/nvim-cmp",
dependencies = {
"https://github.com/hrsh7th/cmp-buffer",
"https://github.com/hrsh7th/cmp-path",
"https://github.com/hrsh7th/cmp-cmdline",
"https://github.com/hrsh7th/cmp-nvim-lsp",
"https://github.com/hrsh7th/cmp-nvim-lsp-signature-help",
-- "https://github.com/hrsh7th/cmp-nvim-lua",
-- "https://github.com/saadparwaiz1/cmp_luasnip",
},
event = { "InsertEnter", "CmdlineEnter", "BufReadPost" },
config = function()
local cmp = require("cmp")
cmp.setup({
preselect = cmp.PreselectMode.None,
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<C-e>"] = cmp.mapping.abort(),
}),
sources = cmp.config.sources({
{ name = "buffer", option = { keyword_length = 3 }, },
{ name = "path" },
{ name = "nvim_lsp" },
{ name = 'nvim_lsp_signature_help' },
-- { name = "nvim_lua" },
-- { name = "luasnip" },
{ name = "lazydev" },
{ name = "neorg" },
}),
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, item)
item.kind = item.kind
item.menu = ({
buffer = "[buf]",
path = "[path]",
cmdline = "[cmd]",
nvim_lsp = "[LSP]",
-- luasnip = "[snip]",
})[entry.source.name] or entry.source.name
return item
end,
},
})
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' },
{ name = 'cmdline' }
})
})
end
},
}