astro-nvim/lua/plugins/cmp.lua

29 lines
667 B
Lua
Raw Permalink Normal View History

2025-01-14 01:41:13 +00:00
return {
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
local cmp = require("cmp")
local lspkind = require('lspkind')
opts.sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
})
opts.experimental = { ghost_text = true }
opts.formatting.fields = {"abbr", "kind", "menu"}
opts.formatting.format = lspkind.cmp_format({
mode = "symbol_text",
menu = ({
buffer = "[BUFFER]",
nvim_lsp = "[LSP]",
luasnip = "[SNIP]",
path = "[PATH]",
})
})
end,
}
}