nvim: after/plugin/cmp: Show LSP kind type name during completion

This commit is contained in:
Sanchayan Maity 2021-12-01 14:30:40 +05:30
parent d0b93a537a
commit 1643837553

View file

@ -13,17 +13,16 @@ cmp.setup {
},
formatting = {
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
vim_item.menu = ({
format = lspkind.cmp_format({
with_text = true,
menu = ({
buffer = '[Buffer]',
nvim_lsp = '[Lsp]',
nvim_lua = '[Lua]',
path = '[Path]',
luasnip = '[Snippet]',
})[entry.source.name]
vim_item.kind = lspkind.presets.default[vim_item.kind]
return vim_item
end,
})
}),
},
snippet = {
expand = function (args)