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 = { formatting = {
fields = { 'kind', 'abbr', 'menu' }, fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item) format = lspkind.cmp_format({
vim_item.menu = ({ with_text = true,
menu = ({
buffer = '[Buffer]', buffer = '[Buffer]',
nvim_lsp = '[Lsp]', nvim_lsp = '[Lsp]',
nvim_lua = '[Lua]', nvim_lua = '[Lua]',
path = '[Path]', path = '[Path]',
luasnip = '[Snippet]', luasnip = '[Snippet]',
})[entry.source.name] })
vim_item.kind = lspkind.presets.default[vim_item.kind] }),
return vim_item
end,
}, },
snippet = { snippet = {
expand = function (args) expand = function (args)