fixed popup icosn

This commit is contained in:
Oliver Hartmann 2022-12-01 17:03:15 +01:00
parent 78544dcdbf
commit 0fcdf98cf3

View File

@ -12,24 +12,11 @@ end
cmp.setup({
formatting = {
format = function(entry, vim_item)
-- fancy icons and a name of kind
vim_item.kind = require('lspkind').presets.default[vim_item.kind] .. ' ' .. vim_item.kind
-- set a name for each source
vim_item.menu = ({
buffer = '[Buffer]',
nvim_lsp = '[LSP]',
ultisnips = '[UltiSnips]',
nvim_lua = '[Lua]',
cmp_tabnine = '[TabNine]',
look = '[Look]',
path = '[Path]',
spell = '[Spell]',
calc = '[Calc]',
emoji = '[Emoji]',
})[entry.source.name]
return vim_item
end,
format = require('lspkind').cmp_format({
mode = 'symbol_text', -- show only symbol annotations
maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
})
},
mapping = {
['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),